Hi team, I’m looking for the way to add email/password login on top of the implementation following the document.
https://web3auth.io/docs/content-hub/guides/cognito
https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-no-modal-sdk/custom-authentication/cognito-react-no-modal-example
Could you kindly help providing me the guide or steps that we need to proceed?
Thanks in advance.
vjgee
August 23, 2023, 6:33am
2
@tkt193yk Welcome Aboard!
Your request has been forwarded to our team and we will get back to you with further updates once more information becomes available.
1 Like
vjgee
August 23, 2023, 9:21am
3
You can setup email/password login with AWS Cognito:
Having to remember passwords can be a pain, especially for passwords that you don’t use often. Like most people, you too are probably familiar with having to click the “forgot password” link or button on websites and apps. Many people are tempted to...
Then follow the guide with Web3Auth + AWS Cognito.
1 Like
Thanks, @vjgee !
I would like to ask you to elaborate on client side implementation.
I assume an idToken is issued after a user signs in with Cognito in the way you suggested.
So, what we need to do on our frontend is to pass the idToken as extraLoginOptions instead of using the Cognito domain as follows?
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "jwt",
extraLoginOptions: {
id_token: "YOUR_GENERATED_ID_TOKEN",
verifierIdField: "sub", // sub, email, or custom
},
});
vjgee
August 23, 2023, 12:37pm
5
Yes, that is correct. In the frontend, pass on this id_token to the Web3Auth No Modal SDK to authenticate the user
const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "jwt",
extraLoginOptions: {
id_token: "YOUR_GENERATED_ID_TOKEN",
domain: "https://YOUR-AWS-COGNITO-DOMAIN",
verifierIdField: "sub",
},
}
);
The major thing to note here is the domain
option in the extraLoginOptions
object. This is the domain of your AWS Cognito pool so that you can be redirected to login there directly from the Web3Auth Plug and Play No Modal SDK.
1 Like
Great! Thank you for helping me here
Hey, this was very useful. Maybe it is worth including as an alternative option in the main documentation.