Unhandled Rejection (SecurityError): The operation is insecure.
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);
});
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.
Solved. the rpID was the trick. I will close issue.