Twitter authentication fails when performing within MM browser

On mobile devices, we are allowing users through our DAPP to authenticate to Twitter/X. This is Authorizing our app to access the user’s X account. We have confirmed this works through normal chrome browser, and other wallets.

However, within the MM mobile browser, during the token exchange, we receive “Failed to exchange request token for access token.”

Has anyone experienced this or tried to authenticate to X on behalf of user from the MM browser?

Hi please check this PR [IMPROVEMENT] Support for 'twitter://' scheme internal browser by andreahaku · Pull Request #3664 · MetaMask/metamask-mobile · GitHub and Can not open another app use scheme url from Metamask Ios browser · Issue #3333 · MetaMask/metamask-mobile · GitHub

1 Like

Thanks 0xroo.

In this case we aren’t trying to launch the twitter app, but authenticate our dapp through twitter api.

…s://api.twitter.com/oauth/authorize?oauth_token=Lr9a1AAAAqscAAAABwliPY

in which we receive the error: “failed to exchange request token for access token.”

I see looks like it’s twitter oath thing could you please reference 1st reply here: android - Oauth 2 fails to exchange code for access token, returns "invalid_grant" - Stack Overflow. There is also laravel - Twitter OAuth Access Token Error: Request token missing - Stack Overflow and Postman
please check your access_token

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.