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