Aggregate verifier returning different wallets

Hi, I’ve a mobile app for both Android and iOS.

I’m trying to setup Google OAuth2 on both of them, due to how Google OAuth2 works, I need different client ids (one for android, and one for ios).

Due to some poor planning, I can’t migrate the PnP on Android yet to SFA so I’ve to maintain a SFA on iOS (due to cookie issues) and PnP on Android.

I tried setting up an aggregate verifier which seems to be the one I need:

.

But it always return different wallets, here’s my code for the PnP:

export const web3auth = new Web3Auth(WebBrowser, SecureStore, {
  clientId,
  sessionTime: 86400 * 7,
  network: OPENLOGIN_NETWORK.SAPPHIRE_DEVNET, // or other networks
  loginConfig: {
    google: {
      verifier: "chainless-google-aggregate",
      verifierSubIdentifier: "google", // the id of the sub identifier so google for Android
      typeOfLogin: "google",
      clientId:
        "<some-client-id-here>"
    }
  }
});

// login.ts
await web3auth.login({
        loginProvider: "google", // uses google oauth2
        redirectUrl: resolvedRedirectUrl, // expo deep link so app://sign-in
        mfaLevel: "none" // no mfa is set on the account
});

And here’s the iOS:

export const web3auth = new Web3Auth(SecureStore, {
  clientId,
  sessionTime: 86400 * 7,
  web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
  enableLogging: true,
  usePnPKey: true // have no idea if this is required or not
});

// login.ts
const provider = await web3auth!.connect({
    verifier: AuthService.GOOGLE_VERIFIER, // chainless-google-aggregate
    verifierId: user.id, // the aggregate uses sub
    idToken, // the google id token 
    subVerifierInfoArray: [
      {
        verifier: "ios-apple",
        idToken, // the google id token again?
      }
    ]
});

Can you please me help me? I’ve no idea what I did wrong and we’re on a deadline :confused:

Hey @thalles.passos, sorry for the delays. Couple of things, since you are using PnP on Android, and SFA on iOS, the aggregate verifier won’t work. CoreKit SFA generates the address based only one share that is social login where as the PnP SDK along with social login uses other share as device share, backup share, and any other recovery share. Since you are already using usePnPKey as true for SFA iOS, it should work fine.

Can you please share more details about your verifier? I see you have on Google social login provider, and second is custom. For aggregate verifier to work, there should a common verifierId field. For instance, in google the verifierId field is email, so in iOS-apple it should be email too. Can you share the screenshot of google sub verifier and ios-apple sub verifier? You can click on edit to to open the sub verifier.

Hi, is it possible to change the google social login verifier field to use an ID?

If you have selected social login provider, you can’t change it. You can create a custom one, and use the custom verifier id, or sub, or email.

Hey @thalles.passos did you solve this issue?

Hi, I just gave up and did a reset on all wallets, thanks!

Btw, could the web3auth team acknowledge this issue I created? Session is not being kept between app initializations · Issue #17 · Web3Auth/single-factor-auth-react-native · GitHub

Sure, I’ll check the issue out and update you.

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