capacitor-community / apple-sign-in

Sign in with Apple Support
MIT License
135 stars 58 forks source link

Apple sign-in invalid credential error #87

Closed Nausad-upswing closed 1 year ago

Nausad-upswing commented 1 year ago

step 1:

const response = await SignInWithApple?.authorize({ clientId: 'bundleID', redirectURI: 'uri', scopes: 'email name', state: '12345', nonce: await this.sha256('nonce') });

step 2:

{"response":{"identityToken":"jwt_token","authorizationCode":"c1e9cff08403a489899f8d9a553f0eaa7.0.srxv.NLOwAm6zdla_qcaIGKWSSA","email":null,"givenName":null,"user":"000175.eb8a9f72de094925aeb0f8d02d509768.0522","familyName":null}}

step 3:

credential: new OAuthProvider('apple.com')?.credential({ idToken: user?.response?.identityToken, accessToken: user?.response?.authorizationCode, rawNonce: 'nonce' })

step 4:

signInWithCredential(getAuth(), credential)

error: { "code":"auth/invalid-credential", "customData":{"appName":"[DEFAULT]"}, "name":"FirebaseError" }