Hi,
I’m struggling to find out how to obtain Auth0 credentials, after having successfully authenticated my user with Google in my Android App following Google Sign In instructions (การผสานรวม Google Sign-In กับแอป Android | Authentication | Google Developers).
I have basically tried 2 approaches:
-
Obtained an
idToken
from Google like this:val googleSignInIdTokenOptions = Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestScopes("open_id , email, etc… ")
.requestIdToken(BuildConfig.OATH2_WEB_CLIENT_ID)
.requestEmail()
.build()
val googleSignInClient = GoogleSignIn.getClient(activity, googleSignInIdTokenOptions)
activity.startActivityForResult(googleSignInClient.signInIntent, 2468)
Then in onActivityResult()
I obtain the google account with the idToken
.
- Or, obtained an
serverAuthCode
from Google like this:
val googleSignInOptions = Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestScopes(Scope(Scopes.EMAIL), Scope(Scopes.PROFILE))
.requestServerAuthCode(BuildConfig.OATH2_CLIENT_ID)
.requestEmail()
.build()
val googleSignInClient = GoogleSignIn.getClient(activity, googleSignInOptions)
activity.startActivityForResult(googleSignInClient.signInIntent, 2468)
Then in onActivityResult()
I obtain the google account with the serverAuthCode
.
Then this is the point where I’m lost. How do I use either the idToken
or the serverAuthCode
to exchange it for Auth0 credentials ?
Thanks a lot !