SimpleWebAuthn icon indicating copy to clipboard operation
SimpleWebAuthn copied to clipboard

Unhandled Rejection (SecurityError): The operation is insecure.

Open guus2006 opened this issue 5 years ago • 2 comments

My browser console is throwing error "Unhandled Rejection (SecurityError): The operation is insecure." when I start Registration. I am unable to understand why.

Unhandled Rejection (SecurityError): The operation is insecure. startRegistration node_modules/@simplewebauthn/browser/dist/bundle/index.js:54

my React code, using AWS Amplify to make API call. API .get(apiName, pathRegisterRequest, myInitRegisterRequest) .then(async (response) => { const attResp = await startRegistration(await response.data); const myInitRegisterResponse = { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(attResp), response: true, }; return API.post(apiName, pathRegisterResponse, myInitRegisterResponse); }) .then((response) => { console.log(response); });

guus2006 avatar Sep 21 '21 10:09 guus2006

My initial error is on Firefox. Chrome is proving a different error: Uncaught (in promise) DOMException: The relying party ID is not a registrable domain suffix of, nor equal to the current domain.

This makes more sense now as I am in development mode.

guus2006 avatar Sep 21 '21 11:09 guus2006

Solved. the rpID was the trick. I will close issue.

guus2006 avatar Sep 21 '21 11:09 guus2006