Archived Content from Web3Auth Community
This topic was originally posted by benjamin.groves on 7/17/2023.
This content has been migrated from our previous community forum to preserve valuable discussions.
Please provide the following details too when asking for help in this category:
- SDK Version: web3auth/modal 6.0.1
- Platform: Nextjs (web)
Please provide the Web3Auth initialization and login code snippet below:
const openloginAdapter = new OpenloginAdapter({ adapterSettings: { network: network, clientId: WEB3AUTH_CLIENT_ID, uxMode: 'redirect', redirectUrl: [...], }, }); web3auth.configureAdapter(openloginAdapter); await web3auth.initModal({ modalConfig: { [WALLET_ADAPTERS.WALLET_CONNECT_V2]: { label: 'WALLET_CONNECT_V2', showOnModal: false, }, [WALLET_ADAPTERS.TORUS_EVM]: { label: 'TORUS_EVM', showOnModal: false, }, [WALLET_ADAPTERS.OPENLOGIN]: { label: 'openlogin', loginMethods: { phone: DISABLE_SOCIAL_LOGIN_METHOD, google: { name: 'google login', logoDark: 'url to your custom logo which will shown in dark mode', showOnModal: true }, facebook: DISABLE_SOCIAL_LOGIN_METHOD, reddit: DISABLE_SOCIAL_LOGIN_METHOD, discord: DISABLE_SOCIAL_LOGIN_METHOD, twitch: DISABLE_SOCIAL_LOGIN_METHOD, apple: DISABLE_SOCIAL_LOGIN_METHOD, line: DISABLE_SOCIAL_LOGIN_METHOD, github: DISABLE_SOCIAL_LOGIN_METHOD, kakao: DISABLE_SOCIAL_LOGIN_METHOD, linkedin: DISABLE_SOCIAL_LOGIN_METHOD, twitter: DISABLE_SOCIAL_LOGIN_METHOD, weibo: DISABLE_SOCIAL_LOGIN_METHOD, wechat: DISABLE_SOCIAL_LOGIN_METHOD, },// setting it to false will hide all social login methods from modal. showOnModal: true, }, }, });
Hello, we have created a web application that integrates Web3Auth and it works pretty well, thank you. However now we are planning to develop a mobile app version of our platform by creating a hybrid app using a either gonative.io or Capacitorjs. Essentially bundling our existing web application in a WebView based hybrid app.
Unfortunately we immediately ran into a problem with our Google Social login as Google returned a 403 disallowed_useragent error and denied the login attempt. According to their help pages:
If you get an error that says "403 disallowed_useragent," the app uses embedded WebViews. Some developers use WebViews to help display web content in an app. Embedded WebViews puts your security at risk because they could let third parties access and change communications between you and Google.
To keep your account secure, Google no longer allows embedded WebViews as of September 30, 2021.
GoNative are aware of this issue and have proposed a work-around which uses a Javascript bridge to call the Native APIs to get the authentication state from a particular provider. But I am not sure if it is compatible with Web3Auth? → Social Login
Google themselves seem to suggest using custom tabs, but again, not sure if this is compatible.
Considering using an embedded WebView is at the core of our solution, is there any recommended approach to work around this issue from Google? How can we use Google Social login from a mobile embedded WebView application?
Thanks in advance!