stages/authenticator_validate: fix error with get_webauthn_challenge_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>
This commit is contained in:
committed by
GitHub
parent
310983a4d0
commit
e34d4c0669
@ -65,7 +65,7 @@ def get_webauthn_challenge_without_user(
|
|||||||
authentication_options = generate_authentication_options(
|
authentication_options = generate_authentication_options(
|
||||||
rp_id=get_rp_id(request),
|
rp_id=get_rp_id(request),
|
||||||
allow_credentials=[],
|
allow_credentials=[],
|
||||||
user_verification=stage.webauthn_user_verification,
|
user_verification=UserVerificationRequirement(stage.webauthn_user_verification),
|
||||||
)
|
)
|
||||||
request.session[SESSION_KEY_WEBAUTHN_CHALLENGE] = authentication_options.challenge
|
request.session[SESSION_KEY_WEBAUTHN_CHALLENGE] = authentication_options.challenge
|
||||||
|
|
||||||
|
|||||||
@ -164,8 +164,9 @@ class AuthenticatorValidateStageWebAuthnTests(FlowTestCase):
|
|||||||
"""Test webauthn (userless)"""
|
"""Test webauthn (userless)"""
|
||||||
request = get_request("/")
|
request = get_request("/")
|
||||||
stage = AuthenticatorValidateStage.objects.create(
|
stage = AuthenticatorValidateStage.objects.create(
|
||||||
name=generate_id(),
|
name=generate_id(), webauthn_user_verification=UserVerification.PREFERRED
|
||||||
)
|
)
|
||||||
|
stage.refresh_from_db()
|
||||||
WebAuthnDevice.objects.create(
|
WebAuthnDevice.objects.create(
|
||||||
user=self.user,
|
user=self.user,
|
||||||
public_key=(
|
public_key=(
|
||||||
|
|||||||
Reference in New Issue
Block a user