Hi! We are having some issues with Custom Authentication for Twitter and Apple, with slightly different errors for both.
For reference, we are already able to successfully connect using Google and Discord custom auth.
Error: [Error: Error occurred while verifying params unable to verify jwt token, [failed to verify jws signature: failed extract from compact serialization format: invalid number of segments failed to verify jws signature: failed extract from compact serialization format: invalid number of segments]]
Hi João! Thank you for reaching out to the Web3Auth community. I’ve gathered the details from your message to help our support team address the issues you’re facing with Custom Authentication for both Twitter and Apple.
SDK Details:
SDK: tKey JS SDK
SDK Version: 15.1.0
Platform: React Native - Expo SDK 51
Issues Encountered:
Apple Custom Auth:
Verifier Name: rn-apple.0
Error:Error occurred while verifying params unable to verify jwt token, [failed to verify jws signature: failed to verify message: crypto/rsa: verification error]
Error:Error occurred while verifying params unable to verify jwt token, [failed to verify jws signature: failed extract from compact serialization format: invalid number of segments]
Your Web3Auth initialization and login code snippets (if you haven’t shared them already).
Since you’re already successfully connecting with Google and Discord, we will work to identify what might be going wrong with the Apple and Twitter integrations.
Feel free to share any additional links or information that might be relevant. Looking forward to helping you resolve these issues!
Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.
While reviewing the verifier details, I noticed that you have configured it to use Auth0 with Twitter. I believe you’re receiving the idToken in the tokenRes, but in your code, it seems you are passing the access_token instead of the idToken.
Could you please share the JWT token you receive from Auth0? Additionally, can you explain how you are initiating the login process to obtain the idToken?
Any ResponseType in the useAuthRequest config other than code doesn’t work (token or idToken). But then we are using this authorization code to request a token directly to https://api.x.com/2/oauth2/token and that’s our tokenRes. The issue is that we are only receiving an access token, no Id Token. tokenRes example:
A similar thing happened with discord. We only receive a bearer access token from discord’s /token endpoint, but in this one passing that token to the idToken param of the connect method works perfectly
I believe it would be best to discuss this issue over a call. We hold weekly Office Hours on Tuesdays and Thursdays, during which one of our engineers or developer relations team members is available to address your concerns. The next session is scheduled for tomorrow. I hope you can join us.