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.
re...@google.com <re...@google.com>
sg...@google.com <sg...@google.com> #3
This is likely related to your google account used. Have you try setting this bit to false: setFilterByAuthorizedAccounts(FALSE)?
If setting it to false doesn't work, can you please grab a bugreport and attach to this bug?
Description
Version used:1.2.2
Devices/Android versions reproduced on: Android TV
I've implemented the latest sign in modal that google provides with the latests versions, which is a small pop up that comes from the bottom with accounts to choose, this is working fine on Mobile Devices, but on TVs I'm seing this error on 99% of users that tries to use this feature:
During begin sign in, failure response from one tap: 16: [28433] Cannot find a matching credential.
Which I thought might be related with users not having a google account set up on their devices, but testing this theory only throws the next message
During begin sign in, failure response from one tap: 16: Cannot find a matching credential.
Which does not have the 28433 code, I would like to know what that code means and where can I find more info about this error codes, here is an snippet of how I'm presenting this on the app:
suspend fun launchGoogleSignIn(
authorizedAccountOnly: Boolean
): String {
val googleIdOption = GetGoogleIdOption.Builder()
.setFilterByAuthorizedAccounts(authorizedAccountOnly) // Query all google accounts on the device
.setServerClientId(googleClientID)
.build()
val request = GetCredentialRequest.Builder()
.addCredentialOption(googleIdOption)
.build()
try {
val credentialManager = CredentialManager.create(context)
val result = credentialManager.getCredential(context, request)
when (val credential = result.credential) {
is CustomCredential -> {
if (credential.type == GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_CREDENTIAL) {
try {
return GoogleIdTokenCredential.createFrom(credential.data).idToken
} catch (e: GoogleIdTokenParsingException) {
throw e
}
} else throw Exception("Unexpected type of credential")
}
else -> throw Exception("Unexpected type of credential")
}
} catch (e: GetCredentialCancellationException) {
throw GoogleSignInCancelled(e.localizedMessage)
} catch (e: NoCredentialException) {
throw DeviceWithNoCredentials(e.localizedMessage)
}
}