Estoy tratando de implementar el inicio de sesión de Apple con la función signInWithCredential modular v9 de firebase.
He estado siguiendo la documentación tanto en Firebase como en Apple, pero sigo recibiendo el siguiente error cuando intento ejecutar signInWithCredential:
[TypeError: undefined no es un objeto (evaluando 'credential._getIdTokenResponse')]
Puedo hacer que aparezca el inicio de sesión de Apple y usar un biométrico para autenticar. Esto me da un token de identidad que he verificado en jwt.io. Es solo en signInWithCredentials donde arroja un error.
¿Alguien puede ver lo que estoy haciendo mal?
const appleCredential = await AppleAuthentication.signInAsync({ requestedScopes: [ AppleAuthentication.AppleAuthenticationScope.FULL_NAME, AppleAuthentication.AppleAuthenticationScope.EMAIL ], state: csrf, nonce: hashedNonce }); const { identityToken, authorizationCode } = appleCredential; if (identityToken) { const authCredential = new OAuthProvider( "apple.com" ).credential({ idToken: identityToken, accessToken: authorizationCode, rawNonce: nonce // nonce value from above }); signInWithCredential(authCredential) .then((credential) => { console.log(credential?.providerId) }).catch(e => { console.log("error in apple auth: ", e) }) }