This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.
Secure contextThis feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The Credential
interface of the Credential Management API provides information about an entity (usually a user) as a prerequisite to a trust decision.
Credential
objects may be of 3 different types:
Properties
Credential.id
Read only- Returns a
DOMString
containing the credential's identifier. This might be any one of a GUID, username, or email address. Credential.type
Read only- Returns a
DOMString
containing the credential's type. Valid values arepassword
,federated
andpublic-key
. (ForPasswordCredential
,FederatedCredential
andPublicKeyCredential
)
Event handlers
None.
Methods
None.
Examples
let pwdCredential = new PasswordCredential({
id: "example-username", // Username/ID
name: "John Doe", // Display name
password: "correct horse battery staple" // Password
});
console.assert(pwdCredential.type === "password");
Specifications
Specification | Status | Comment |
---|---|---|
Credential Management Level 1 | Working Draft | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 51 |
Edge
Full support 18 |
Firefox
Full support 60 |
IE
No support No |
Opera
Full support 38 |
Safari
Full support 13 |
WebView Android
Full support 51 |
Chrome Android
Full support 51 |
Firefox Android
Full support Yes |
Opera Android
Full support 41 |
Safari iOS
Full support 13.3 |
Samsung Internet Android
Full support 5.0 |
Chrome
Full support 51 |
Edge
Full support 18 |
Firefox
Full support 60 |
IE
No support No |
Opera
Full support 38 |
Safari
Full support 13 |
WebView Android
Full support 51 |
Chrome Android
Full support 51 |
Firefox Android
Full support Yes |
Opera Android
Full support 41 |
Safari iOS
Full support 13.3 |
Samsung Internet Android
Full support 5.0 | |
Chrome No support 51 — 52 No support 51 — 52 Notes' See Bug 602980. |
Edge
? |
Firefox
No support No |
IE
No support No |
Opera No support 38 — 39 No support 38 — 39 Notes' See Bug 602980. |
Safari
? |
WebView Android No support 51 — 52 No support 51 — 52 Notes' See Bug 602980. |
Chrome Android No support 51 — 52 No support 51 — 52 Notes' See Bug 602980. |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
? |
Samsung Internet Android No support 5.0 — 6.0 No support 5.0 — 6.0 Notes' See Bug 602980. | |
Chrome
Full support 51 |
Edge
Full support 18 |
Firefox
Full support 60 |
IE
No support No |
Opera
Full support 38 |
Safari
Full support 13 |
WebView Android
Full support 51 |
Chrome Android
Full support 51 |
Firefox Android
Full support Yes |
Opera Android
Full support 41 |
Safari iOS
Full support 13.3 |
Samsung Internet Android
Full support 5.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- See implementation notes.'
- See implementation notes.
Credential by Mozilla Contributors is licensed under CC-BY-SA 2.5.