After getting the token ID using await web3authSfa.authenticateUser(), I validate the token using next code:
// Get the JWK set used to sign the JWT issued by Web3Auth
const jwks = jose.createRemoteJWKSet(
new URL('https://api-auth.web3auth.io/jwks')
); // for social logins
// const jwks = jose.createRemoteJWKSet(
// new URL('https://api.openlogin.com/jwks')
// );
// Verify the JWT using Web3Auth's JWKS
const jwtDecoded = await jose.jwtVerify(idToken, jwks, {
algorithms: ['ES256'],
});
I guess the problem happens because I am generating the token from a test environment. If this is the issue I can’t find the correct JWKS endpoint.
Documentation is a bit misleading though. I picked the JWT token from a session that was initialised with Google, so I assumed I needed to use the Social Login Verification endpoint.
Did you mention that you’re obtaining the idToken from Google? If so, are you using Firebase or direct Google login?
To ensure proper configuration, you’ll need to use JWKS (JSON Web Key Sets). You can find detailed instructions on how to create and set up JWKS here. We’ve provided the JWKS locations for Auth0, Firebase, Google, and AWS Cognito.