From e0079b5a86185c774ea7eda73f139c8a457e2435 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 25 May 2022 10:58:02 -0400 Subject: [PATCH] Amend webauthn validation api --- confluent_server/confluent/webauthn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/webauthn.py b/confluent_server/confluent/webauthn.py index 9c5c362a..731b33e5 100644 --- a/confluent_server/confluent/webauthn.py +++ b/confluent_server/confluent/webauthn.py @@ -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: