Open TheNotorius0 opened 3 months ago
As a follow up of this issue: https://github.com/dpa99c/cordova-plugin-firebasex/issues/857
I've tried using signInWithCredential of Firebase javascript SDK after signing-in with Apple with the following code:
signInWithCredential
FirebasePlugin.authenticateUserWithApple(function (credential) { const appleProvider = new firebase.auth.OAuthProvider('apple.com'); const appleWebCredentials = appleProvider.credential({idToken: credential.idToken}); firebase.auth().signInWithCredential(appleWebCredentials).then((result) => { showToastShort('Logged-in with Apple'); }); });
Unfortunately, it gave me this error:
FirebaseError: Firebase: Nonce is missing in the request. (auth/missing-or-invalid-nonce).
I already manually fixed the issue by modifying the plugin (passing the rawNonce) and it now works. This is what I changed:
[result setValue:rawNonce forKey:@"rawNonce"]; on line 527, under [result setValue:idToken forKey:@"idToken"]; of the AppDelegate+FirebasePlugin file.
[result setValue:rawNonce forKey:@"rawNonce"];
[result setValue:idToken forKey:@"idToken"];
AppDelegate+FirebasePlugin
The Cordova updated and working code now is:
const appleWebCredentials = appleProvider.credential({idToken: credential.idToken, rawNonce: credential.rawNonce});
Could this change be implemented in an upcoming release? Thank you in advance!
As a follow up of this issue: https://github.com/dpa99c/cordova-plugin-firebasex/issues/857
I've tried using
signInWithCredential
of Firebase javascript SDK after signing-in with Apple with the following code:Unfortunately, it gave me this error:
FirebaseError: Firebase: Nonce is missing in the request. (auth/missing-or-invalid-nonce).
I already manually fixed the issue by modifying the plugin (passing the rawNonce) and it now works. This is what I changed:
[result setValue:rawNonce forKey:@"rawNonce"];
on line 527, under[result setValue:idToken forKey:@"idToken"];
of theAppDelegate+FirebasePlugin
file.The Cordova updated and working code now is:
const appleWebCredentials = appleProvider.credential({idToken: credential.idToken, rawNonce: credential.rawNonce});
Could this change be implemented in an upcoming release? Thank you in advance!