Skip to content

Commit

Permalink
stages/authenticator_validate: fix error with get_webauthn_challenge_…
Browse files Browse the repository at this point in the history
…without_user (cherry-pick #8625) (#8626)

stages/authenticator_validate: fix error with get_webauthn_challenge_without_user (#8625)

* stages/authenticator_validate: fix error with get_webauthn_challenge_without_user



* fix tests



---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens L <jens@goauthentik.io>
  • Loading branch information
gcp-cherry-pick-bot[bot] and BeryJu committed Feb 21, 2024
1 parent 310983a commit e34d4c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion authentik/stages/authenticator_validate/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_webauthn_challenge_without_user(
authentication_options = generate_authentication_options(
rp_id=get_rp_id(request),
allow_credentials=[],
user_verification=stage.webauthn_user_verification,
user_verification=UserVerificationRequirement(stage.webauthn_user_verification),
)
request.session[SESSION_KEY_WEBAUTHN_CHALLENGE] = authentication_options.challenge

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ def test_get_challenge_userless(self):
"""Test webauthn (userless)"""
request = get_request("/")
stage = AuthenticatorValidateStage.objects.create(
name=generate_id(),
name=generate_id(), webauthn_user_verification=UserVerification.PREFERRED
)
stage.refresh_from_db()
WebAuthnDevice.objects.create(
user=self.user,
public_key=(
Expand Down

0 comments on commit e34d4c0

Please sign in to comment.