Status Update
Comments
he...@google.com <he...@google.com> #2
A lot of thanks Varoot for the detailed bug report!
I am able to reproduce this issue and confirm it is a bug. When the user taps out or dismisses the dialog in any other way, you should expect to receive the
Working on a fix now and will report back on when it will be relased.
ap...@google.com <ap...@google.com> #3
Branch: androidx-main
commit 30bc433be253e025de208514abf083c9c18e6fba
Author: Helen Qin <helenqin@google.com>
Date: Tue Mar 07 02:46:46 2023
Properly report the user cancellation error.
For passkey registration flow, user cancellation was improperly reported
as a ConstraintError. Now it should report
CreateCredentialCancellationException.
Bug: 271863184
Test: unit tested and locally verified.
Change-Id: I9ff3448a98cd8df945b2589f0b8ab64d636d2b09
M credentials/credentials-play-services-auth/src/main/java/androidx/credentials/playservices/controllers/CreatePublicKeyCredential/PublicKeyCredentialControllerUtility.kt
he...@google.com <he...@google.com> #4
Hey!
The fix is complete and is on track to go into the next release (ETA March 22nd).
In the meantime, to try this out you can use a snapshot SDK from
Step 1: Add the following maven url line to your build.gradle file.
allprojects {
repositories {
google()
jcenter()
maven { url 'https://androidx.dev/snapshots/builds/9700081/artifacts/repository' }
}
}
Step 2: Depend on the snapshot version artifact:
dependencies {
def work_version = '1.0.0-SNAPSHOT'
implementation "androidx.credentials:credentials-play-services-auth:$work_version"
...
}
pr...@google.com <pr...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.credentials:credentials-play-services-auth:1.0.0-alpha05
sh...@gmail.com <sh...@gmail.com> #6
The same error 'CreatePublicKeyCredentialDomException' is thrown with weird error message (errorMessage) - "Unable to get sync account."
va...@shopify.com <va...@shopify.com> #7
I also confirm that the issue still exists in 1.0.0-alpha05
va...@shopify.com <va...@shopify.com> #8
I think the error type changed from ConstraintError to NotAllowedError for alpha05, but still not CreateCredentialCancellationException as expected.
he...@google.com <he...@google.com> #9
It's possible that ConstraintError is thrown once the passkey flow is started. This is according to the webauthn spec:
"If the user does not consent, return an error code equivalent to "NotAllowedError" and terminate the operation."
"If the user exercises a user agent user-interface option to cancel the process" ... "Throw a "NotAllowedError" DOMException."
Therefore, for a passkey request, you should be ready to handle both the CancellationException and the PublicKeyCredentialException(ConstraintError) as a signal for user cancellation.
va...@shopify.com <va...@shopify.com> #10
Therefore, for a passkey request, you should be ready to handle both the CancellationException and the PublicKeyCredentialException(ConstraintError) as a signal for user cancellation.
You mean NotAllowedError
?
he...@google.com <he...@google.com> #11
Oops good catch. Yes by ConstraintError
I meant NotAllowedError
Description
Component used: Credentials
Version used: 1.0.0-alpha03
Devices/Android versions reproduced on: Huawei P30 Pro (VOG-L29)
I have multiple Google accounts on my phone. After triggering the passkey registration modal, I pressed the "Cancel" button and I got a CreatePublicKeyCredentialDomException with ConstraintError instead of the expected CreateCredentialCancellationException
Here are some logs (PasskeyUtils is from my application):