Problem with getting twitter user details using auth0, web3auth login works

Hi everyone,

We are currently developing a web 3.0 app that aims to register new crypto wallets using Twitter login. We’re utilizing the web3auth library to connect the wallet with social login and auth0 to handle the linking process with Twitter. So far, we have successfully implemented the Twitter login functionality, created new wallet accounts based on registered Twitter accounts, and stored them in our database.

However, we are encountering an issue when attempting to retrieve additional user information from Twitter and add it to our database. We have reviewed the Twitter API documentation and made attempts to retrieve the data but have been unsuccessful thus far.

Upon logging in using Twitter, we receive a callback response from web3auth with the following information:

{
   aggregateVerifier: "VERIFIER_NAME"
   dappShare: ""
   email: ""
   idToken: "ID_TOKEN"
   name: "Yusuf Affandi"
   oAuthAccessToken: "OAUTH_ACCESS_TOKEN"
   oAuthIdToken: "OAUTH_ID_TOKEN"
   profileImage: "https://pbs.twimg.com/profile_images/491676557518192640/T7H-nRS7_normal.jpeg"
   typeOfLogin: "twitter"
   verifier: "VERIFIER_NAME"
   verifierId: "VERIFIER_ID"
}

Unfortunately, we are unable to use any of the provided tokens to establish a connection with the Twitter API and retrieve the desired information, similar to the response obtained from the https://api.twitter.com/1.1/account/verify_credentials.json API

Hello @tools,

Have you attempted to decode the idToken that we provide? It contains additional information about users.

I have included a decoded token that was given after using Web3Auth to log in to Twitter.

If you are utilizing a custom verifier and have inputted your Twitter credentials while setup, you can extract the oAuthAccessToken from the response to access additional information through API calls.

It has been a while we did not receive any response from you. If you still need help, feel free to reply.

You may join our upcoming community call - Web3Auth Community Call #4 · Zoom · Luma

@shahbaz but still we are not getting the twitter handle of the user right? how do we get it?

{
“iat”: 1721299180,
“aud”: “BI9MhY_4Fd3dY74w05owvgo1MBkwyNcjVVn9olaTfiWOI9e_qgkUlRxHH1jwx3xVQfIkWWWozS9s40g-sOz433M”,
“nonce”: “03af060b2d245b8787a88074f1ad8a465c88e25b7d5e5709dce722033545f4a9ec”,
“iss”: “https://api-auth.web3auth.io”,
“wallets”: [
{
“public_key”: “02eecbef730374bb5b23adb653e357bae7e2e739ef207b18c915bb31c38946cf8c”,
“type”: “web3auth_app_key”,
“curve”: “secp256k1”
},
{
“public_key”: “02803165cd5cb2ecc709533e081f98e6ece9d41f295e09cd4b767220dddaa83de0”,
“type”: “web3auth_threshold_key”,
“curve”: “secp256k1”
}
],
“name”: “gsagas asdf”,
“profileImage”: “https://pbs.twimg.com/profile_images/1424338391370375172/O2sRPQvN_normal.jpg”,
“verifier”: “web3auth”,
“verifierId”: “twitter|821682769269059584”,
“aggregateVerifier”: “web3auth-auth0-twitter-sapphire-devnet”,
“exp”: 1721385580
}

Hey @nayyaralisha12345

Please use a custom twitter verifier to get more details from Auth0 in oAuthIdToken and oAuthAccessToken. And use the oAuthAccessToken to make direct API calls to get more info directly from twitter.