From 76ad2c8925831f1815329bc1d740c9be3fb7e6d7 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 22:48:24 +0100 Subject: [PATCH] stages/authenticator_webauthn: fix error when enrolling new device (cherry-pick #8738) (#8740) stages/authenticator_webauthn: fix error when enrolling new device (#8738) Signed-off-by: Jens Langhammer Co-authored-by: Jens L --- authentik/stages/authenticator_webauthn/stage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentik/stages/authenticator_webauthn/stage.py b/authentik/stages/authenticator_webauthn/stage.py index 836e05df087d..6b44c6a6b9ab 100644 --- a/authentik/stages/authenticator_webauthn/stage.py +++ b/authentik/stages/authenticator_webauthn/stage.py @@ -10,6 +10,7 @@ from webauthn.helpers.bytes_to_base64url import bytes_to_base64url from webauthn.helpers.exceptions import InvalidRegistrationResponse from webauthn.helpers.structs import ( + AuthenticatorAttachment, AuthenticatorSelectionCriteria, PublicKeyCredentialCreationOptions, ResidentKeyRequirement, @@ -91,7 +92,7 @@ def get_challenge(self, *args, **kwargs) -> Challenge: # set, cast it to string to ensure it's not a django class authenticator_attachment = stage.authenticator_attachment if authenticator_attachment: - authenticator_attachment = str(authenticator_attachment) + authenticator_attachment = AuthenticatorAttachment(str(authenticator_attachment)) registration_options: PublicKeyCredentialCreationOptions = generate_registration_options( rp_id=get_rp_id(self.request),