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 CredentialsContainer
interface of the the Credential Management API exposes methods to request credentials and notify the user agent when events such as successful sign in or sign out happen. This interface is accessible from Navigator.credentials
.
Properties
None.
Event handlers
None.
Methods
CredentialsContainer.create()
Secure context- Returns a
Promise
that resolves with a newCredential
instance based on the provided options, ornull
if noCredential
object can be created. In exceptional circumstances, thePromise
may reject. CredentialsContainer.get()
Secure context- Returns a
Promise
that resolves with theCredential
instance that matches the provided parameters. CredentialsContainer.preventSilentAccess()
Secure context- Sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty
Promise
. For example, you might call this, after a user signs out of a website to ensure that he/she isn't automatically signed in on the next site visit. Earlier versions of the spec called this methodrequireUserMediation()
. See Browser compatibility for support details. CredentialsContainer.store()
Secure context- Stores a set of credentials for a user, inside a provided
Credential
instance and returns that instance in aPromise
.
Examples
// TBD
Specifications
Specification | Status | Comment |
Credential Management Level 1 | Working Draft | Initial definition. |
Web Authentication: An API for accessing Public Key Credentials Level 1 | Recommendation | 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 Yes |
IE
No support No |
Opera
No support No |
Safari
Full support 13 |
WebView Android
Full support 51 |
Chrome Android
Full support 51 |
Firefox Android
Full support Yes |
Opera Android
No support No |
Safari iOS
Full support 13.3 |
Samsung Internet Android
Full support 5.0 |
Chrome
Full support 60 |
Edge
Full support 18 |
Firefox
Full support Yes |
IE
No support No |
Opera
No support No |
Safari
Full support 13 |
WebView Android
Full support 60 |
Chrome Android
Full support 60 |
Firefox Android
Full support Yes |
Opera Android
No support No |
Safari iOS
Full support 13.3 |
Samsung Internet Android
Full support 8.0 | |
Chrome
Full support 51 |
Edge
Full support 18 |
Firefox
Full support Yes |
IE
No support No |
Opera
No support No |
Safari
Full support 13 |
WebView Android
Full support 51 |
Chrome Android
Full support 51 |
Firefox Android
Full support Yes |
Opera Android
No support No |
Safari iOS
Full support 13.3 |
Samsung Internet Android
Full support 5.0 | |
Chrome Full support 60 Full support 60 No support 51 — 60 Alternate Name' Uses the non-standard name: |
Edge
Full support ≤79 |
Firefox
Full support Yes |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android Full support 60 Full support 60 No support 51 — 60 Alternate Name' Uses the non-standard name: |
Chrome Android Full support 60 Full support 60 No support 51 — 60 Alternate Name' Uses the non-standard name: |
Firefox Android
Full support Yes |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android Full support 8.0 Full support 8.0 No support 5.0 — 8.0 Alternate Name' Uses the non-standard name: | |
Chrome
Full support 51 |
Edge
Full support ≤79 |
Firefox
Full support Yes |
IE
No support No |
Opera
No support No |
Safari
? |
WebView Android
Full support 51 |
Chrome Android
Full support 51 |
Firefox Android
Full support Yes |
Opera Android
No support No |
Safari iOS
? |
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.
- Uses a non-standard name.'
- Uses a non-standard name.
CredentialsContainer by Mozilla Contributors is licensed under CC-BY-SA 2.5.