This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
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.
returns a Promise
which resolves with a Credential
if one can be created using the options provided, or null
if no Credential
can be created. In exceptional circumstances, the Promise
may reject
Methods
CredentialsContainer.create()
- Returns a
Promise
that resolves with a newCredential
instance based on the provided options, ornull
of noCredential
object can be created. CredentialsContainer.get()
- Returns a
Promise
that resolves with theCredential
instance that matches the provided parameters. CredentialsContainer.preventSilentAccess()
- 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()
- 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 | Editor's Draft | Initial definition. |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support |
51 |
? | ? | No support | ? |
create() |
60 | ? | ? | No support | ? |
requireUserMediation() renamed preventSilentAccess() |
60 | ? | ? | No support | ? |
Feature | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support |
51 |
51 |
? | ? | ? | No support | ? |
create() |
60 | 60 | ? | ? | ? | No support | ? |
requireUserMediation() renamed preventSilentAccess() |
60 | 60 | ? | ? | ? | No support | ? |