setting up the Android Firebase on Android.
I need to get the unique identifier of the user, so that I can have consistency accross all platforms no matter if the email is hided or not.
Based upon https://firebase.google.com/docs/auth/android/apple , using .startActivityForSignInWithProvider(this, provider.build()) we can see:
public void onSuccess(AuthResult authResult) {
Log.d(TAG, "checkPending:onSuccess:" + authResult);
// Get the user profile with authResult.getUser() and
// authResult.getAdditionalUserInfo(), and the ID
// token from Apple with authResult.getCredential().
And from Apple https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/authenticating_users_with_sign_in_with_apple#3383773 we can also see
The identity token is a JSON Web Token (JWT) and contains
and
sub
The subject registered claim identifies the principal that’s the subject of the identity token. Because this token is for your app, the value is the unique identifier for the user.
Question:
What I got from firebase is AuthCredential , but I am expecting JWT with "sub" in it.
How can I get it?