-
Notifications
You must be signed in to change notification settings - Fork 0
Integration with Firebase
Nate River edited this page Jul 1, 2025
·
7 revisions
I'm not a developer of Firebase and can't provide support for it. Please refer to Firebase docs and consider this article as some experience sharing.
As Firebase requires that nonce should be hashed with SHA256 for further JWT validation, you can generate a random nonce and pass it to SignIn method as an optional parameter. It will be hashed, URL-endoded and passed to Apple with your authorization request.
More info: https://firebase.google.com/docs/auth/ios/apple
- Open your project in Firebase Console
- Navigate to Authentication
- Go to Sign-in method
- Select Apple from Sign-in providers (if not available, click "Add new provider" and add Apple)
- Specify the Identifier of the Services ID you created in the Services ID.
var appleAuth = new AppleAuth();
var nonce = Guid.NewGuid().ToString("N");
var tokenResponse = await appleAuth.GetTokenResponseAsync(nonce);
var credential = OAuthProvider.GetCredential("apple.com", tokenResponse.IdToken, nonce, tokenResponse.AccessToken);
// Usage example:
// FirebaseAuth.SignInAndRetrieveDataWithCredentialAsync(credential);
// FirebaseUser.LinkWithCredentialAsync(credential);
- Open your project in Firebase Console
- Navigate to Authentication
- Go to Sign-in method
- Select Google from Sign-in providers (if not available, click "Add new provider" and add Google)
- Under "Safelist client IDs from external projects (optional)", add the client ID you created
var googleAuth = new GoogleAuth();
var tokenResponse = await googleAuth.GetTokenResponseAsync();
var credential = GoogleAuthProvider.GetCredential(tokenResponse.IdToken, tokenResponse.AccessToken);
// Usage example:
// FirebaseAuth.SignInAndRetrieveDataWithCredentialAsync(credential);
// FirebaseUser.LinkWithCredentialAsync(credential);
Please share your experience in our Discord channel.