serenity-kit / opaque

Secure password based client-server authentication without the server ever obtaining knowledge of the password. Implementation of the OPAQUE protocol.
https://opaque-auth.com
MIT License
38 stars 5 forks source link

"Error: opaque protocol error at \"deserialize registrationRecord\"; Internal error encountered" #113

Closed 6peterlu closed 4 months ago

6peterlu commented 4 months ago

Hello!

I successfully set up the register user part, so I can create registrationRecords in my database, but when I attempt to do login, I am getting this error on the server side:

                    "Error: opaque protocol error at \"deserialize registrationRecord\"; Internal error encountered",
                    "    at imports.wbg.__wbindgen_error_new (/Users/plu/draftzero/node_modules/@serenity-kit/opaque/cjs/index.js:496:21)",
                    "    at opaque::<impl core::convert::From<opaque::Error> for wasm_bindgen::JsError>::from::hf14551759b156af9 (wasm://wasm/00115332:wasm-function[195]:0x27eec)",
                    "    at opaque::start_server_login::h0c8da74413fafc89 (wasm://wasm/00115332:wasm-function[56]:0xe1ae)",
                    "    at startServerLogin (wasm://wasm/00115332:wasm-function[197]:0x280ad)",
                    "    at Object.startServerLogin [as startLogin] (/Users/plu/draftzero/node_modules/@serenity-kit/opaque/cjs/index.js:312:14)",

I'm wondering if you could help me understand what might be happening here and what fields I should check. Thank you!

Here are the relevant strings (not used in production): registration record: Arz_Q4B_rMSh09MUpnI0CESqiFIv3EW5UC7Flq6LJQlmbrMyodDosEvGKi5WvUlazjswNkz-4uik87wVKDOLQQ

start login request: 9kJBgsaMfbRgL9vM8wsF1Bi-qDprfVgdO1BBa2i6Wjf-51yA-6C0wkJQZVsAM6MbwlWqo7GLfZA7_BGCy2bzOt5KEL4V2pwTGjfPzNZJWJBi1SPLZ-z_ewd3v8m5XCh9

server setup: puiAt6AEZeZPbWt7rKj1jXCv76gBrIF9WqGy9oK6583YEE_G5sXBYWuarMxlvaoF6rrLIEDlwTNGsnVE_NUN3UrdyH0M-uIUcJ-xbONrV3B-GZE5By1UGdCuI54exXsGihMVoptoB7E8eW8tDbQIwJibpMpTY7bwOBk5V7Bo9ws

user identifier: d65857ad-8982-4259-a4de-c42b078b459a;

6peterlu commented 4 months ago

I figured it out! It turns out I was passing clientRegistrationState as my registrationRecord.