Getting different private key for same google email in android and iOS

Please provide the following details too when asking for help in this category:

  • SDK Version: 1.1.0
  • Screenshots of error:
  • Related to Custom Authentication? Please provide the following info too: (Optional)
    • Verifier Name:
    • JWKS Endpoint:
    • Sample idToken(JWT)

Please provide the Web3Auth initialization and login code snippet below:

Hello @anwar.hussain,

I kindly request that you check out one of our Flutter sample applications and let me know if you are able to replicate it.

You can find the sample apps at:

Additionally, I noticed that you are currently using version 1.1.0. Would you please update to the latest version, which is 1.3.0?

Thank you for your cooperation.

Hi @shahbaz Thanks for the response.

It was working fine. Recently we created custom-auth-verifier for web non-modal integration. After that it started giving different privKey in Android and iOS.

Hope this detail will help you in identifying the cause.

Waiting for you reply again.

Thanks in advance.

We have encountered the same problem where different private keys were generated between Flutter and web. @shahbaz

Hey @iota.9star and @anwar.hussain

To obtain the same key across our SDK, please use the same combination in both.

  • Same web3auth network. e.g., cyan
  • Same client ID.
  • Same verifier details
  • Same login method.

Note: Please note that using Google login and EmailPasswordless login with a Gmail address are considered two separate login methods.

Thank you and let us know if you have any questions or concerns.

@shahbaz
We have been investigating for a long time and have not found anything specific. We are sure that we have used the same ClientId and network, and the only difference is that the web uses a verifier. Below is our code.

Web:

Flutter:

Web3AuthFlutter.login(
      LoginParams(
        loginProvider: enums.Provider.google,
        curve: enums.Curve.ed25519,
        mfaLevel: enums.MFALevel.NONE,
      ),
);

Hi there, @iota.9star!

To ensure that you get the same keys, you need to use the same verifier in your Flutter code as well. This is because the Web3Auth default verifier is being used, which can lead to different keys for you.

final loginConfig = HashMap<String, LoginConfigItem>();
    loginConfig['jwt'] = LoginConfigItem(
        verifier: "****t-website-google", // get it from web3auth dashboard
        typeOfLogin: TypeOfLogin.google,
        name: "Web3Auth Flutter Google Example",
        clientId: "google client id"
        );

    await Web3AuthFlutter.init(Web3AuthOptions(
        clientId: 'your client id',
        network: Network.cyan,
        redirectUrl: redirectUrl,
        loginConfig: loginConfig));
  }

Then do the login.

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