Skip to content

Commit

Permalink
WIP Work with new fido2 api arthepsy#32
Browse files Browse the repository at this point in the history
  • Loading branch information
keis committed Jan 27, 2022
1 parent 527e160 commit b95f185
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gp-okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,15 +656,20 @@ def okta_mfa_webauthn(conf, factor, state_token):
client = Fido2Client(dev, origin)
print('!!! Touch the flashing U2F device to authenticate... !!!')
try:
result = client.get_assertion(purl[1], challenge, allow_list)
dbg(conf.debug, 'assertion.result', result)
result = client.get_assertion({
'challenge': challenge.encode('utf-8'),
'rp_id': purl[1],
'allow_credentials': allow_list
})
dbg(conf.debug, 'assertion.result', vars(result))
break
except Exception:
traceback.print_exc(file=sys.stderr)
result = None
if not result:
return None
assertion, client_data = result[0][0], result[1] # only one cred in allowList, so only one response.
assertion = result.get_assertions()[0] # only one cred in allowList, so only one response.
client_data = result._client_data
data = {
'stateToken': state_token,
'clientData': to_n((base64.b64encode(client_data)).decode('ascii')),
Expand Down

0 comments on commit b95f185

Please sign in to comment.