[Archive] Getting Error while Login with Google

:classical_building: Archived Content from Web3Auth Community

This topic was originally posted by bsrinath4839 on 9/1/2025.
This content has been migrated from our previous community forum to preserve valuable discussions.


When asking for help in this category, please make sure to provide the following details:

  • SDK Version(package.json):
    “@toruslabs/eccrypto”: “^6.0.0”,
    “@web3auth/auth-adapter”: “^9.5.2”,
    “@web3auth/base”: “^9.5.2”,
    “@web3auth/base-provider”: “^9.5.2”,
    “@web3auth/no-modal”: “^9.5.2”,

  • Platform:
    Web

  • Browser Console Screenshots:

  • If the issue is related to Custom Authentication, please include the following information (optional):

    • Verifier Name:
    • JWKS Endpoint:
    • Sample idToken (JWT):
import { Web3AuthNoModal as Web3Auth } from "@web3auth/no-modal";
import { CommonPrivateKeyProvider } from "@web3auth/base-provider";
import { web3AuthChainConfig, web3AuthCliedId } from "./constants";
import { ADAPTER_EVENTS, WEB3AUTH_NETWORK } from "@web3auth/base";
import { AuthAdapter } from "@web3auth/auth-adapter";
import { KEPLR_CONNECTED, KEPLR_CONNECTING, KEPLR_DISCONNECTED, KEPLR_ERRORED } from "./events.keplr";

export const initWeb3Auth = async ({
handleKeplrConnected = ()=> { },
handleKeplrConnecting = ()=> { },
handleKeplrDisconnected = ()=> { },
handleKeplrErrorred = ()=> { },
handleWeb3AuthConnected = ()=> { },
handleWeb3AuthConnecting = ()=> { },
handleWeb3AuthDisconnected = ()=> { },
handleWeb3AuthErrored = ()=> { },
}) => {
try {
const privateKeyProvider = new CommonPrivateKeyProvider({
config: { chainConfig: web3AuthChainConfig },
});

window.web3auth = new Web3Auth({
  clientId: web3AuthCliedId,
  privateKeyProvider,
  uiConfig: {
    appName: "Sentinel AI",
    logoDark: `${window.location.origin}/logo512.svg`,
    logoLight: `${window.location.origin}/logo512.svg`,
    mode: "auto",
    useLogoLoader: true,
  },
  web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
});

const authAdapter = new AuthAdapter({
  adapterSettings: {},
  loginSettings: { mfaLevel: "optional" },
});

window.web3auth.configureAdapter(authAdapter);
await window.web3auth.init();

window.web3auth.on(ADAPTER_EVENTS.CONNECTING, handleWeb3AuthConnecting);
window.web3auth.on(ADAPTER_EVENTS.CONNECTED, handleWeb3AuthConnected);
window.web3auth.on(ADAPTER_EVENTS.DISCONNECTED, handleWeb3AuthDisconnected);
window.web3auth.on(ADAPTER_EVENTS.ERRORED, handleWeb3AuthErrored);
window.addEventListener(KEPLR_CONNECTED, handleKeplrConnected);
window.addEventListener(KEPLR_DISCONNECTED, handleKeplrDisconnected);
window.addEventListener(KEPLR_CONNECTING, handleKeplrConnecting);
window.addEventListener(KEPLR_ERRORED, handleKeplrErrorred);
return true;

} catch (e) {
console.log(“::ERROR::”, e);
return false;
}
};

Thanks for sharing the detailed information and the screenshot! Here’s a summary of your issue for the support team, along with a few clarifying questions and suggestions to help resolve your problem:


Issue Summary

  • SDK: Web3Auth Plug and Play (PnP) Web SDK (@web3auth/no-modal)
  • SDK Version: @web3auth/no-modal@9.5.2, @web3auth/auth-adapter@9.5.2, @web3auth/base@9.5.2, @web3auth/base-provider@9.5.2
  • Platform: Web
  • Login Method: Google
  • Error: Error occurs during login with Google (see attached screenshot)
  • Initialization Code: Provided in detail above
  • Web3Auth Network: SAPPHIRE_MAINNET
  • Custom Authentication: Not explicitly mentioned; using standard Google login (please confirm if you are using a custom verifier)

Next Steps & Suggestions

  1. Check for loginConfig:
    In your initialization code, there is no loginConfig provided. If you are using a custom Google verifier (created in the Web3Auth Dashboard), you should pass a loginConfig object with the correct verifier, typeOfLogin, and clientId.
    Reference: Custom Authentication Setup

    Example:

    const loginConfig = {
      google: {
        verifier: "YOUR_VERIFIER_NAME", // from Web3Auth Dashboard
        typeOfLogin: "google",
        clientId: "YOUR_GOOGLE_CLIENT_ID"
      }
    };
    

    window.web3auth = new Web3Auth({
    clientId: web3AuthCliedId,
    privateKeyProvider,
    uiConfig: { … },
    web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
    loginConfig, // <– Add this line
    });

  2. Confirm Verifier Setup:

    • Are you using a default Web3Auth Google login, or did you set up a custom verifier in the dashboard?
    • If custom, please provide:
      • Verifier Name
      • Google Client ID
      • (If possible) a sample idToken (JWT) and/or JWKS endpoint
  3. Error Details:
    The screenshot you provided might contain a specific error message in the console. If possible, please paste the exact error message text here, as it will help the team pinpoint the issue.


Resources


Please confirm:

  • Are you using a custom verifier for Google login, or the default?
  • If custom, please provide your verifier name and Google client ID.
  • If you see a specific error message in the browser console, please paste it here.

Once we have this info, the support team can assist you more effectively!

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

Hi,

Not sure if I can share those details or not.
But one thing I can say is that the login is working on localhost.

Is it related to any whitelisting?