Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 [auth] Allow passing in raw nonce when using signInWithCredential #8346

Open
henribru opened this issue Feb 18, 2025 · 2 comments
Open
Labels
Needs Attention type: enhancement Implements a new Feature

Comments

@henribru
Copy link

When using signInWithCredential, there doesn't appear to be a way to pass in the raw nonce, which is required if you're using an id token that contains a nonce: https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/OAuthProvider.CredentialBuilder#setIdTokenWithRawNonce(java.lang.String,java.lang.String)

Maybe it could just be added to the AuthCredential interface and then passed down into the native signInWithCredential along with the provider ID, token and secret

@henribru henribru added Needs Attention type: enhancement Implements a new Feature labels Feb 18, 2025
@mikehardy
Copy link
Collaborator

Hey @henribru - how do they do it in firebase-js-sdk ? Our "job" - in the sense of discriminating between things we can do here and things we cannot - is to implement the firebase-js-sdk APIs, either directly binding them to identical APIs in firebase-ios-sdk / firebase-android-sdk or doing internal things to "bend" what an firebase-js-sdk-compatible API implementation gives us into whatever shape the native firebase-android-sdk / firebase-ios-sdk make available to us, so that we end up with similar results

So always best to start with the firebase-js-sdk guides and reference docs to see how they would to it as that will have to be our API, then check the native ios/android docs make available to see if it is feasible in the native context

@henribru
Copy link
Author

They do it basically how I'm suggesting, I believe. When creating a credential rawNonce is one of the options you can pass in:
https://firebase.google.com/docs/reference/js/auth.oauthprovider.md#oauthprovidercredential
https://firebase.google.com/docs/reference/js/auth.oauthcredentialoptions.md#oauthcredentialoptions_interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention type: enhancement Implements a new Feature
Projects
None yet
Development

No branches or pull requests

2 participants