Skip to content

Any way to log in with google and CredentialManager? #725

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

Open
Puskistolero92 opened this issue May 24, 2025 · 1 comment
Open

Any way to log in with google and CredentialManager? #725

Puskistolero92 opened this issue May 24, 2025 · 1 comment

Comments

@Puskistolero92
Copy link

hi i am trying to log in with google and its one tap using credential manager but i have not found the way to do it.
do you have to do it from the common part or with expect/actual?

@RaphaelHx
Copy link

@Puskistolero92 if your firebase users have google accounts linked to them, then theres a few ways to implement the Google sign in step, but this library doesn't manage that for you as far as I know. Theres a few guides on how to implement Google single sign on such as:

https://medium.com/@arezoo.nazerdeylami/implementing-google-sign-in-with-kotlin-and-compose-multiplatform-8fad1898b866
https://proandroiddev.com/integrating-google-sign-in-into-kotlin-multiplatform-8381c189a891
https://euryperez.dev/compose-multiplatform-login-with-google-cc3217a99349

And a library that can help is https://github.com/mirzemehdi/KMPAuth

After the google single sign on is complete, your app receives an id_token and access_token, and to log into the firebase user you can do the something like:

import dev.gitlive.firebase.auth.FirebaseAuth
import dev.gitlive.firebase.auth.GoogleAuthProvider

val tokenResult = googleAuth.signIn() // implementation you chose for google single sign in
val cred = GoogleAuthProvider.credential(tokenResult.idToken, tokenResult.accessToken)
val firebaseResult = auth.signInWithCredential(cred)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants