We’re currently facing an issue with Twitter authentication using Web3Auth. It works perfectly on laptops/desktops via browsers, but on mobile devices (both Android and iPhones), the authentication fails—even though everything is properly whitelisted.
Has anyone else experienced this issue? Is this a known limitation/bug with Web3Auth on mobile, or could it be something in our implementation?
Thanks for sharing the details about your Twitter authentication issue on mobile with Web3Auth. Here’s a summary for the support team and a few suggestions to help troubleshoot:
Issue Summary
SDK/Platform: Web3Auth Plug n Play (PnP)
Authentication Provider: Twitter
Devices Affected: Mobile (Android & iOS)
Works On: Desktop/Laptop browsers
Issue: Twitter authentication fails on mobile devices, despite correct whitelisting.
To Help Diagnose Further
Could you please provide the following (if possible):
Web3Auth Initialization & Login Code Snippet
This will help us check if the loginConfig and redirect URIs are set up correctly for mobile flows.
Error Message or Screenshot
If there’s any error message shown during the failed login, a screenshot or the exact message would be helpful.
SDK Version
Which version of the Web3Auth SDK are you using? (This helps us check for known issues.)
Are you using a Custom Verifier?
If yes, please provide the verifier name and Twitter login method details.
If using your own authentication, please share the JWKS endpoint and a sample idToken (JWT).
Possible Causes & Suggestions
Twitter OAuth on Mobile:
Twitter’s OAuth flow can behave differently on mobile browsers or in-app browsers (like WebView). Sometimes, pop-up blockers or redirect URI mismatches cause issues. Make sure your redirect URIs are correctly whitelisted for both web and mobile.
dApp Share & Custom Verifiers:
If you’re using a custom verifier, confirm that the dApp share and related settings are correctly implemented as described in the PnP iOS and React Native docs.
Browser Context:
On mobile, authentication often involves switching between apps (your app ↔ browser ↔ app). If the browser context is lost or cookies are cleared, the auth flow may break.
Next Steps
Please share the requested code snippets and error details.
We’ll help you get this sorted as quickly as possible! If you have any screenshots or logs, please upload them—they can speed up the troubleshooting process.
Thank you for your patience!
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.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours
SDK Version: Web3Auth Plug n Play (PnP) - Latest version Platform: Web Application (React/Next.js) Issue: Twitter authentication fails on mobile browsers while working perfectly on desktop Environment: Both development and production environments affected
Initialization Code
// Standard Web3Auth initialization
const web3auth = new Web3AuthNoModal({
clientId: CLIENT_ID,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET, // Also tested on DEVNET
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth"
}
});
// Twitter login configuration
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "twitter"
});
Domain Whitelisting: All domains properly whitelisted in Web3Auth dashboard including:
Production domain
Development domains
All redirect URIs correctly configured
Error Behavior:
Works perfectly on desktop browsers (Chrome, Firefox, Safari)
Works on mobile browser emulators
Fails on actual mobile devices (iOS Safari, Android Chrome)
Shows “could not validate redirect, please whitelist your domain” despite correct whitelisting (Infect we have all the domains whitelisted)