-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help at the verify_authentication_response() function #208
Comments
Hello @Satistile, what's the base64url value of |
The |
Without a sample value for |
A sample value for the |
This is bizarre, that
When I drop that hex into https://cbor.me the site says the bytes are "the value -17", with "90 unused bytes after the end of the data item": So this is telling me that there's something potentially misbehaving with the browser and/or authenticator, before @simplewebauthn/browser base64url-encodes the output from WebAuthn's @Satistile What OS, browser, their versions, and authenticator are you attempting to support here? Might as well let me know what version of @simplewebauthn/browser you're using too (I doubt it's the culprit but just to be safe.) |
I don't actually know the version of my @simplewebauthn/browser, but I use it in my website with the recommended way without typescript ( I hope these informations are helpful. |
Maybe it's also helpful to know, that the registration process don't throws any errors and runs without any problems. |
I've thought a bit about the issue, and came to the conclusion that the error might have happened while the storing process of the public key. Corresponding code: def verify_registration_response_func(request):
content_type = request.headers.get('Content-Type')
if content_type == 'application/json':
request_json = request.json
# get user id from client json and prepare payload for processing
logged_in_user_id = request_json['id']
request_payload_object = json.loads(base64url_to_string(request_json['payload']))
# get current challenge from user
current_challenge = base64url_to_bytes(db_calls.get_challenge(logged_in_user_id))
# verify challenge
try:
credential = request_payload_object
verification = verify_registration_response(
credential=credential,
expected_challenge=current_challenge,
expected_rp_id="localhost",
expected_origin="http://localhost:63342",
require_user_verification=True,
)
except Exception as err:
db_calls.delete_challenge(logged_in_user_id)
return {"verified": False, "msg": str(err), "status": 400}
# remove challenge from database and add public key to db
db_calls.delete_challenge(logged_in_user_id)
db_calls.add_key(logged_in_user_id, credential["response"]["publicKey"])
return {"verified": True}
else:
return 'Content-Type not supported!' I hope that this might help a bit |
Oh this was a mistake, sorry |
I currently try to implement the py_webauthn library in a little test project, but currently the
verify_authentication_response()
function seems to not work correctly.Here's my code (I currently work with flask):
And here's the replied JSON from it:
{"msg":"'int' object is not subscriptable","status":400,"verified":false}
The error seems to occour while the processing of the public key. And this is the point, where I don't get what's wrong. After the registration process is completed, I save the public key directly in my database. The public key is send directly from the client, where the @simplewebauthn/browser framework had processed the options and replied the public key as a base64url string.
I currently still don't know if this is my error or an error in the library. Thanks in advance for helping!
Edit:
Here's the complete traceback:
The text was updated successfully, but these errors were encountered: