felipe
1
Is there any example about how to set up Apple with Firebase? I’ve done for Google and Twitter/X by following this code https://github.com/Web3Auth/web3auth-pnp-examples/blob/main/web-no-modal-sdk/custom-authentication/single-verifier-examples/firebase-no-modal-example/src/App.tsx
I see that GoogleAuthProvider and TwitterAuthProvider are being imported from firebase/auth, but there’s no AppleAuthProvider
TomTom
2
Hi @felipe,
We don’t have an example of how to do it with Firebase, but here’s an example of how to set it up with auth0.
Please let me know if this link helps you.
felipe
3
Hi @TomTom . I’ve already set up with Auth0, but I would like to use Firebase. Could you provide some guidance?
felipe
4
I believe I just got it working. Could you confirm this is correct?
const appleProvider = new OAuthProvider('apple.com');
appleProvider.addScope('email');
appleProvider.addScope('name');
const loginRes = await signInWithPopup(auth, appleProvider);
console.log("login details", loginRes);
const idToken = await loginRes.user.getIdToken(true);
console.log("idToken", idToken);
const provider = await web3auth?.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "jwt",
extraLoginOptions: {
id_token: idToken,
verifierIdField: "sub",
domain: "http://localhost:3000",
},
});
setProvider(provider)
TomTom
5
please try it and tell me.
I see everything ok !
1 Like
felipe
6
yep it worked, thank you!
system
Closed
7
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.