This topic was originally posted by miguel on 7/14/2023.
This content has been migrated from our previous community forum to preserve valuable discussions.
I am trying to use web3auth to get the idToken but it is comping up empty. I have tried with the the passwordless email and Google providers and both have the same issue. I am testing on testnet.
Only upside I see is that the error is consistent, which differs from what I’ve found in the forums.
// Testnet
chainId: "0x13881",
rpcTarget: "https://rpc.ankr.com/polygon_mumbai",
};
const web3auth = new Web3AuthNoModal({
clientId,
web3AuthNetwork: "testnet",
chainConfig,
});
const privateKeyProvider = new EthereumPrivateKeyProvider({
config: { chainConfig } as unknown as EthereumPrivKeyProviderConfig,
});
// Configure how we want web3auth to handle MFA and other settings it allows
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
network: "testnet",
},
privateKeyProvider,
});
web3auth.configureAdapter(openloginAdapter);
await web3auth.init();
const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "email_passwordless",
extraLoginOptions: {
login_hint: "john@doe.com",
},
});
I’ve noticed that if I used my testnet client id with the cyan network, it works correctly locally. It does not work in our live domain with this set up.
I also tried using the cyan client id with the cyan network in our live domain and it does the same thing, idToken comes up empty.
Hey @miguel,
We have an example already on email-passwordless but that uses auth0. I’ll link it here for your convenience. But if this doesn’t work for you, let me know the verifier you are using and the code snippet you are using to console.log the idToken.
Hey @miguel, I tried using your code snippet and I noticed that the blockExplorer parameter is missing in the chainConfig. I tried the email passwordless flow on on our example using the same SDK you’re using, i.e. Web3AuthNoModal. It is providing the idToken.
I am leaving the link here, I understand you’re using it in a React app. Try out the email passwordless flow. I am able to get the idToken.