Make RP_ID a constant
This commit is contained in:
parent
b8b1313db9
commit
3ab3f819b7
|
@ -40,11 +40,11 @@ def fido():
|
||||||
|
|
||||||
next_url = request.args.get("next")
|
next_url = request.args.get("next")
|
||||||
|
|
||||||
rp_id = urlparse(SITE_URL).hostname
|
RP_ID = urlparse(SITE_URL).hostname
|
||||||
|
|
||||||
webauthn_user = webauthn.WebAuthnUser(
|
webauthn_user = webauthn.WebAuthnUser(
|
||||||
user.fido_uuid, user.email, user.name, False,
|
user.fido_uuid, user.email, user.name, False,
|
||||||
user.fido_credential_id, user.fido_pk, user.fido_sign_count, rp_id)
|
user.fido_credential_id, user.fido_pk, user.fido_sign_count, RP_ID)
|
||||||
|
|
||||||
# Handling POST requests
|
# Handling POST requests
|
||||||
if fido_token_form.validate_on_submit():
|
if fido_token_form.validate_on_submit():
|
||||||
|
|
|
@ -28,7 +28,7 @@ def fido_setup():
|
||||||
|
|
||||||
fido_token_form = FidoTokenForm()
|
fido_token_form = FidoTokenForm()
|
||||||
|
|
||||||
rp_id = urlparse(SITE_URL).hostname
|
RP_ID = urlparse(SITE_URL).hostname
|
||||||
|
|
||||||
# Handling POST requests
|
# Handling POST requests
|
||||||
if fido_token_form.validate_on_submit():
|
if fido_token_form.validate_on_submit():
|
||||||
|
@ -42,7 +42,7 @@ def fido_setup():
|
||||||
challenge = session['fido_challenge']
|
challenge = session['fido_challenge']
|
||||||
|
|
||||||
fido_reg_response = webauthn.WebAuthnRegistrationResponse(
|
fido_reg_response = webauthn.WebAuthnRegistrationResponse(
|
||||||
rp_id,
|
RP_ID,
|
||||||
SITE_URL,
|
SITE_URL,
|
||||||
sk_assertion,
|
sk_assertion,
|
||||||
challenge,
|
challenge,
|
||||||
|
@ -70,7 +70,7 @@ def fido_setup():
|
||||||
challenge = secrets.token_urlsafe(32)
|
challenge = secrets.token_urlsafe(32)
|
||||||
|
|
||||||
credential_create_options = webauthn.WebAuthnMakeCredentialOptions(
|
credential_create_options = webauthn.WebAuthnMakeCredentialOptions(
|
||||||
challenge, 'Simple Login', rp_id, fido_uuid,
|
challenge, 'Simple Login', RP_ID, fido_uuid,
|
||||||
current_user.email, current_user.name, False, attestation='none')
|
current_user.email, current_user.name, False, attestation='none')
|
||||||
|
|
||||||
# Don't think this one should be used, but it's not configurable by arguments
|
# Don't think this one should be used, but it's not configurable by arguments
|
||||||
|
|
Loading…
Reference in a new issue