I have issues on creating a new wallet through the custom jwt flow on PnP SDK for React Native. I created a verifier, insert the right data (double checked), the JWKS endpoint is right, working and returns this set of keys:
{
"kty":"RSA",
"use":"sig",
"n":"j2eR24WqEBeCex4CTsPeFcYJTXs55NLCc41XGq2YePxIkr_vQcnJETZa7_wkhlU3Jc1yqfdOVtsB....",
"e":"AQAB",
"kid":"hDHSD99ZhWftZeKYEOk2e",
"x5t":"3ydM4whaqv1nq2tmRoIdpGgmV4U",
"x5c":[
"MIIDHTCCAgWgAwIBAgIJXs8xqP2Y6accMA0GCSqGSIb3DQEBCwUAMCwxKjAoBgNVBAMTIWRl...."
],
"alg":"RS256"
},
I’m creating the JWT on the backend signing it with this set of JWKS and using it to create the wallet. This is the decode token:
HEADER
{
"alg": "HS256",
"typ": "JWT",
"kid": "hDHSD99ZhWftZeKYEOk2e"
}
PAYLOAD
{
"sub": "spazioscientifico",
"iss": "...",
"aud": "...",
"iat": 1698493794,
"exp": 1699098594
}
In the frontend this is how I initialize and use the SDK:
const web3authTest = new Web3Auth(WebBrowser, SecureStore, {
clientId: WEB3_AUTH_CLIENT_ID,
network: OPENLOGIN_NETWORK.TESTNET,
loginConfig: {
jwt: {
verifier: 'elysiumlab-testnet',
typeOfLogin: LOGIN_PROVIDER.JWT,
clientId: WEB3_AUTH_CLIENT_ID,
},
},
})
await web3auth?.login({
loginProvider: LOGIN_PROVIDER.JWT,
redirectUrl: resolvedRedirectUrl,
extraLoginOptions: {
id_token: account.access_token, // Get jwt
verifierIdField: 'sub', // auth0 generally uses sub as unique identifier
},
})
I’m using this version of the SDK: "@web3auth/react-native-sdk": "^5.0.0",
When trying to connect the jwt with the SDK I alway get this error:
What am I missing here? Is there anything wrong in the JWT structure?
Thank you very much