2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Amend webauthn validation api

This commit is contained in:
Jarrod Johnson 2022-05-25 10:58:02 -04:00
parent c93f09bc91
commit e0079b5a86

View File

@ -62,7 +62,10 @@ def handle_api_request(url, env, start_response, username, cfm, headers, reqbody
opts['challenge'] = base64.b64encode(opts['challenge']).decode('utf8')
start_response('200 OK', headers)
yield json.dumps(opts)
elif url == '/validate':
elif url.startswith('/validate/'):
username = url.rsplit('/', 1)[-1]
if not isinstance(username, bytes):
username = username.encode('utf8')
rp = pywarp.RelyingPartyManager('Confluent Web UI', credential_storage_backend=TestBackend())
req = json.loads(reqbody)
for x in req: