To complete registration you'll need the same header values as used in Initiate Authentication
Request Spec
HTTP Method: POST
Headers:
X-Scope-Id: A UUID string representing the application scope.
X-Encrypted-Key: A string containing the encrypted key for secure communication.
X-Encrypted-User: The user input encrypted using the encryption key
Body:
encrypted_assertion: A string containing the encrypted user assertion data.
To create an encrypted_assertion, first have to decrypt the encrypted_request_challenge from the response in Initiate Authentication, with the following functions.
constrequest_challenge_str=awaitaesDecrypt(initAuthResponse.result.encrypted_request_challenge, aesKey);constrequest_challenge_json=JSON.parse(request_challenge_str) // Once you have the credential creation options you can create a webauthn compatible // assertion / signature e.g by using the broswer navigator.credentials.get// functionconstassertion=navigator.credentials.get(request_challenge_json);
You can then encrypt the attestation with your AES Key and send it as part of the request
challenge_id: A UUID string representing the unique challenge for this authentication request, returned from Initiate Authentication
Encrypt user for headers.
const params = { username:"test_user", userDisplayName:"test_user"}// Same aesKey created with `generateAesKey`const encrypted_user = await aesEncrypt(JSON.stringify(params), aesKey);
Response Spec
Body:
encrypted_jwt: A string containing the encrypted JSON Web Token (JWT) if authentication is successful.
Request Example
POST / HTTP/1.1Host:https://tiramisu.0xpass.iContent-Type:application/jsonX-Scope-Id:123e4567-e89b-12d3-a456-426614174000X-Encrypted-Key:jp6t2GVOvzltN+4VGc21ZKPIbLjEvitE34cFYDvVNrcmF2ukcKMTO8R/F0wbonGZM0NZBg2X94FvirH6Hi2U1zFlXN5srkOdvQL3lVNZ86gbfEtJFPOEAeZkxtTOKOsH4ZXPtUbFOjT2Niblo8njOKibOoAMRKIhtsNTTvRXjHRxnNqVs3QcSe7XbO1DbH/pdRgq+YZN13znlSRsupu4G/h/KBEZr98wXFo8PeDV9F8ZV56F90GqQ3wKzFUBwC9rJihGz0omH+eJA0jB/K7BYt30fhWDnqaLNP2eb1mbIjBCmv6sXqu2jtghr3ejl0YwjP9lCO+aVD7bophfb/IyKg==X-Encrypted-User:JZVjZw33OGoQDEMcbOdckx4TzspQEKP5j+iAGqf6b6gPleziY/Noyd4uW6KMSujq0HKP2Rb69p9Wi8ic5O8LZl9oTmmWk4op0CUKejqcV5DsNDp83PYzUg=={"jsonrpc":"2.0","method":"completeAuthentication","params": {"encrypted_assertion":"JZVjZw33OGoQDEMcbOdckx4TzspQEKP5j+iAGqf6b6gPleziY/Noyd4uW6KMSujq0HKP2Rb69p9Wi8ic5O8LZl9oTmmWk4op0CUKejqcV5DsNDp83PYzUg==","challenge_id":"123e4567-e89b-12d3-a456-426614174000", },"id":1}