Note: This feature is available in Web Workers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The IdentityCredentialError() constructor creates a new IdentityCredentialError object.
new IdentityCredentialError()
new IdentityCredentialError(message)
new IdentityCredentialError(message, options)messageA description of the error. If not present, the empty string '' is used.
options OptionalAn object that can have the following properties:
error OptionalA string. This can be either one of the values listed in the OAuth 2.0 specified error list or an arbitrary string.
url OptionalA URL pointing to human-readable information about the error to display to users, such as how to fix the error or contact customer service.
try {
const cred = await navigator.credentials.get({
identity: {
providers: [
{
configURL: "https://idp.example/manifest.json",
clientId: "1234",
},
],
},
});
} catch (e) {
const error = e.error;
const url = e.url;
}