-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please provide / document a method for controlling whether a PIN is requested #246
Comments
This behavior is defined by the WebAuthn and CTAP2 specification, and thoroughly documented there. A 5.4 YubiKey with a PIN set will always require PIN verification when creating a new credential. Whether or not you are prompted for PIN when going an assertion depends on the value of userVerification parameter as described here https://www.w3.org/TR/webauthn-2/#dictdef-authenticatorselectioncriteria Note that the UserInteraction implementation in the example code caches the PIN, so you will not be prompted for it more than once. |
Thank you for the help.
Can you be more specific?
Is this per FIDO spec, or a Yubico 5.4 implementation detail? If the latter, is it documented somewhere?
That's Webauthn - we're talking about pure CTAP. The |
If you're using the Fido2Client class then we're not just talking CTAP, we're also talking WebAuthn. The client implements a WebAuthn-like client and is intended to for the most part act as a WebAuthn-capable browser would. If you want to use pure CTAP2, then you'll need to use the Ctap2 class directly instead. The Fido2Client takes the Options-objects defined in WebAuthn, and will respect the userVerification parameter. The specific requirement of PIN for YK 5.4 comes from CTAP2 where make credential always requires UV, if configured up until |
Thanks much for the help.
Ah, okay. So I suppose that that's why Fido2Client seems to have no option to suppress user presence checking, since that's not allowed in WebAuthn. I've actually already implemented a largely working local encryption application using python-fido2 and the Fido2Client class, but I suppose that if I want to suppress the UP checks, I'll have to rewrite it using the Ctap2 class directly.
I was making some embarassing mistakes in passing the parameter properly, but I have it working now. For anyone who comes across this, here's an example:
I still haven't been able to figure out the proper format of a
which executes without error, but Edit: I realized that the spec requires UP for use of the hmac-secret extension ("If "up" is set to false, authenticator returns CTAP2_ERR_UNSUPPORTED_OPTION."), so I guess there's no reason not to just stick with Fido2Client. |
I've been experimenting with the provided example code (
credential.py
,hmac-secret.py
) with a Yubico Security Key running firmware 5.4.3 (with support for 'U2F_V2', 'FIDO_2_0', and 'FIDO_2_1_PRE') and a PIN configured, and no matter what I try, I can't control when I'm asked for a PIN and when I'm not -make_credential
always asks for a PIN, andget_assertion
never does, no matter what options I try to set.The text was updated successfully, but these errors were encountered: