Native "login with apple | google"?

Hi, I want to integrate native login into my react native app, I dont want to redirect the user to an external browser (due to apple tracking issues and also its more convenient).

So far I’ve an access token from the native login but I don’t know how I’ll connect that token with web3auth. Also I would want to keep the current accounts so the change would be seamless in theory.

Is there any docs on that?

Hi @thalles.passos
I hope you are doing fine !
You can check all our PnP react native examples → web3auth-pnp-examples/react-native at main · Web3Auth/web3auth-pnp-examples · GitHub

Also you can check our docs for PnP SDK → Custom Authentication in PnP React Native SDK | Documentation | Web3Auth
and our docs for SFA in the CoreKit SDK → Web3Auth Core Kit Single Factor Auth React Native SDK | Documentation | Web3Auth with some examples → web3auth-core-kit-examples/mpc-core-kit-react-native at main · Web3Auth/web3auth-core-kit-examples · GitHub

Please contact us if you have any question after checking our the information.

Hi, isn’t there any native login for react native? by native I mean this:

I see that I can implement that with corekit using an idToken but I dont want to lose all my users from plug-in-play. Also, due to how Google APIs work, I don’t even know if I can move to web someday because of its weird OAuth2 credentials.

hi @thalles.passos

please check this url → Different Private Keys/ Wallet Address across Integrations | Documentation | Web3Auth

Also, @Ayush will assist you further with this question.

Hey @thalles.passos you can use custom authentication with PnP as well, checkout the documentation. For the second issue of keeping the current accounts, that won’t be possible. The accounts are based on the verifiers you used, either global verifiers, or your custom verifiers. You can promote users for migrating their assets.

That’s sad, really wanted to keep the global verifiers but okay. Another question, Google requires different type of OAuth credentials:
image
If I create an "Android’ application type (required for native login) and then later I move my app to the web which requires “Web application” can I somehow keep the current accounts? Basically keeping both of them active but with same accounts.

And also, I’m now trying to use the Plug in Play as suggested but it seems that it requires a browser even tho I’ve an id token already, what can I do?

const web3auth = new Web3Auth(WebBrowser, EncryptedStorage, {
  clientId,
  // IMP START - Whitelist bundle ID
  redirectUrl,
  // IMP END - Whitelist bundle ID
  network: OPENLOGIN_NETWORK.SAPPHIRE_DEVNET, // or other networks
  loginConfig: {
    google: {
      verifier: 'teste',
      typeOfLogin: 'google',
      clientId:
        '556053249389-ci4a8910i2qlbmndjn2me1gbrav8peoh.apps.googleusercontent.com',
    },
  },
});

And the login:

const { idToken } = await GoogleSignin.signIn(); // uses @react-native-google-signin/google-signin
uiConsole("idToken", idToken);
await web3auth.login({
	loginProvider: LOGIN_PROVIDER.GOOGLE,
	extraLoginOptions: {
		id_token: idToken,
		verifierIdField: "email",
	},
});

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