Assigned
Status Update
Comments
bl...@google.com <bl...@google.com> #2
Automated by Blunderbuss job android-credential-manager-autoassigner for config android_credman_config for component 1301097.
he...@gmail.com <he...@gmail.com> #3
The error you posted state "activity is cancelled by the user". This implies the request was cancelled somehow during the request.
Can you grab a bugreport and attach it to this bug?
sg...@google.com <sg...@google.com>
jb...@google.com <jb...@google.com>
sg...@google.com <sg...@google.com> #4
Ali, can you help clarify the whether the ID field is unique, and why sometimes it show up as email while some times it show up as numbers.
Description
The library we have integrated is this. { implementation 'androidx.credentials:credentials:1.2.2' implementation 'androidx.credentials:credentials-play-services-auth:1.2.2' implementation 'com.google.android.libraries.identity.googleid:googleid:1.1.1' } Google login is done using the method below. { val signInWithGoogleOption: GetSignInWithGoogleOption = GetSignInWithGoogleOption.Builder(getString(R.string.google_server_client_id)).build() val request: GetCredentialRequest = GetCredentialRequest.Builder() .addCredentialOption(signInWithGoogleOption) .build() lifecycleScope.launch { try { val result = CredentialManager.create(this).getCredential( request = request, context = this ) handleGoogleSignIn(result) } catch (e: GetCredentialException) {
private fun handleGoogleSignIn(result: GetCredentialResponse) { when (val credential = result.credential) { is CustomCredential -> { if (credential.type == GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_CREDENTIAL) { val googleIdTokenCredential = GoogleIdTokenCredential .createFrom(credential.data) val avatar = googleIdTokenCredential.profilePictureUri?.path?.let { StringUtils.getGoogleAvatar( it ) val openId = googleIdTokenCredential.id
} } openId For some Google accounts, the googleIdTokenCredential.id is a string of numbers like 113982624879606866900, while for other Google accounts, it is an email. I would like to ask if the googleIdTokenCredential.id is unique for each account? We are using the ID to determine user registration. We look forward to your response.