CZ-NIC / django-fido

Django application for FIDO protocol U2F
GNU General Public License v3.0
28 stars 11 forks source link

Resident key is not being stored #206

Closed variable closed 1 year ago

variable commented 1 year ago

Just testing to upgrade to the latest version from version 0.x

I seems the user handle is not stored in the Fido key, I examined the data when adding the authenticator via admin

image

Whereas the 0.x version would not have this discouraged setting

image

Am I missing something?

variable commented 1 year ago

OK... after some digging the newer fido2 package's register_begin has changed, it used to accept parameter resident_key as boolean, eg. resident_key=SETTINGS.resident_key

But the new version now accepts resident_key_requirement which only allows "required", "preferred" or "discouraged"

So testing with "preferred" and it worked


return self.server.register_begin(self.get_user_data(user), credentials,
                                          user_verification=self.user_verification,
                                          resident_key_requirement='required')

Therefore, the DJANGO_FIDO_RESIDENT_KEY settings needs to be changed from boolean to those 3 options