If you’re not using the Embedded Wallet with TypeScript but instead working with the Web SDK, you can go here to see how to handle the verification process.
An example client & server demonstrating the below is available here
Implementation
1
Request IdToken via Client
Once a user has authenticated with an embedded wallet on the client, simply call the corresponding function in order get a JWT from Sequence.
2
Pass JWT to Backend
Make a POST request to your backend with the queried JWT.
3
Import JWT libraries and initialize JWKS
From our express server that the JWT was passed to, we simply import our preferred JWT library to verify the information and initialize our JWKS to verify against. It is also important to ensure that your expected audience is set correctly so that the claim will be properly verified.
4
Decoding JWT and Verifying Claims
Now we can parse the JWT, verify it against our JWKS URI, then validate any of the claims.
5
Update your backend
From here, you now have verified the information corresponding to the JWT and can safely update your backend as needed.