Skip to content
GitLab
Explore
Sign in
Commits on Source (2)
Add support for multi-key new user validation
· 2bb4d0a5
Marco De Donno
authored
Feb 07, 2020
2bb4d0a5
Add the afis user empty navigation
· 66c96372
Marco De Donno
authored
Feb 07, 2020
66c96372
Hide whitespace changes
Inline
Side-by-side
templates/navigations/afis.html
0 → 100644
View file @
66c96372
<div
class=
"icnml_navigation"
>
</div>
views/newuser/__init__.py
View file @
66c96372
...
...
@@ -152,15 +152,24 @@ def do_validate_signin():
user_id
=
session
[
"
user_id
"
]
key
=
config
.
db
.
query_fetchone
(
"
SELECT * FROM webauthn WHERE user_id = %s AND usage_counter > 0 ORDER BY last_usage DESC LIMIT 1
"
,
(
user_id
,
)
)
webauthn_user
=
webauthn
.
WebAuthnUser
(
key
[
"
ukey
"
],
session
[
"
username
"
],
session
[
"
username
"
],
None
,
key
[
"
credential_id
"
],
key
[
"
pub_key
"
],
key
[
"
sign_count
"
],
config
.
RP_ID
)
webauthn_assertion_options
=
webauthn
.
WebAuthnAssertionOptions
(
webauthn_user
,
challenge
)
assertion_dict
=
webauthn_assertion_options
.
assertion_dict
assertion_dict
[
"
userVerification
"
]
=
"
discouraged
"
key_list
=
config
.
db
.
query_fetchall
(
"
SELECT * FROM webauthn WHERE user_id = %s AND active = true
"
,
(
user_id
,
)
)
credential_id_list
=
[]
for
key
in
key_list
:
credential_id_list
.
append
(
{
"
type
"
:
"
public-key
"
,
"
id
"
:
key
[
"
credential_id
"
],
"
transports
"
:
[
"
usb
"
,
"
nfc
"
,
"
ble
"
,
"
internal
"
]
}
)
current_app
.
logger
.
debug
(
"
key
'
{}
'
added to the usable keys
"
.
format
(
key
[
"
credential_id
"
]
)
)
assertion_dict
=
{
"
challenge
"
:
challenge
,
"
timeout
"
:
60000
,
"
allowCredentials
"
:
credential_id_list
,
"
rpId
"
:
config
.
RP_ID
,
"
userVerification
"
:
"
discouraged
"
}
return
jsonify
(
{
"
error
"
:
False
,
...
...