Edit: It’s solved by adding connection: "email"
in the extraLoginOptions
object. But I didn’t find this info from any articles. I will create a new question for that.
Dependencies
"@web3auth/base": "^8.0.0",
"@web3auth/ethereum-provider": "^8.0.1",
"@web3auth/metamask-adapter": "^8.0.1",
"@web3auth/modal": "^8.0.1",
"@web3auth/wallet-connect-v2-adapter": "^8.0.1",
"@web3auth/wallet-services-plugin": "^8.0.1",
"@web3modal/wagmi": "^3.5.5",
Current situation
I am trying to use Aggregate-Verifier. My target is Google, Github and Email Passwordless.
Google and Github work well and create a same wallet address.
Email Passwordless is challenging for me.
I have been reading a couple of articles on that but I cannot find a clue.
- Using Auth0 with Web3Auth Plug and Play No Modal SDK | Web3Auth
- Creating Aggregate Verifier on the Web3Auth Dashboard | Documentation | Web3Auth
- Passwordless Connections
- Configure Email or SMS for Passwordless Authentication
Working thing
On the Auth0 Dashboard > Authentication > Passwordless, click ‘Email’ > ‘Try’ tab > I can test the email passwordless feature and it works well. And this is what I want.
Not working thing
I implemented on my app (NextJs) and when I click a button, it redirects to email page but it’s different than what I expect.
When I type my email the page moves to pass word page. Note that it requires password instead of code.
And my code is
...
loginConfig: {
// google setup
// github setup
// email passwordless
auth0emailpasswordless: {
verifier: AGGREGATE_VERIFIER_NAME, // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: AGGREGATE_SUB_VERIFIER_EMAIL_PW_LESS, // Pass the Sub-Verifier here. eg w3a-a0-email-passwordless
typeOfLogin: "jwt", // Pass the type of login provider. For Auth0, it's jwt and not Auth0.
clientId: "<AUTH0-MY-PROJECT-CLIENT-ID>", // Pass the `Client ID` of your Auth0 Application.
},
}
// when a button is clicked
const loginAuth0EmailPasswordless = async () => {
if (!web3auth) {
uiConsole("web3auth not initialized yet");
return;
}
const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "auth0emailpasswordless",
extraLoginOptions: {
domain: "https://<MY-AUTH0-DOMAIN>.us.auth0.com",
verifierIdField: "email",
isVerifierIdCaseSensitive: false,
},
});
setProvider(web3authProvider);
};
I assume it’s some configuration thing but not sure where do look at it.
Can you please help?
Thanks in advance.
Additional question:
I checked already the working example from web3auth-pnp-examples, I see the clientId
on auth0github
and auth0emailpasswordless
are different. Do they must be different?