Fetch API
The IdentityCredentialError() constructor creates a new IdentityCredentialError object.
Syntax
new IdentityCredentialError()
new IdentityCredentialError(message)
new IdentityCredentialError(message, options)
Parameters
message- : A description of the error. If not present, the empty string
''is used.
- : A description of the error. If not present, the empty string
options- : An object that can have the following properties:
error- : A string. This can be either one of the values listed in the OAuth 2.0 specified error list or an arbitrary string.
url- : A URL pointing to human-readable information about the error to display to users, such as how to fix the error or contact customer service.
- : An object that can have the following properties:
Examples
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;
}
Specifications
Browser compatibility
See also
- CredentialsContainer.get()
- ID assertion error responses
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
