Credential Management API
The Credential Management API enables a website to create, store, and retrieve credentials . A credential is an item which enables a system to make an authentication decision: for example, to decide whether to sign a user into an account. We can think of it as a piece of evidence that a user presents to a website to demonstrate that they really are the person they are claiming to be.
Concepts and usage
The central interface is the CredentialsContainer
, which is accessed through the navigator.credentials
property and provides three main functions:
create()
: create a new credential.
store()
: store a new credential locally.
get()
: retrieve a credential, which can then be used to log a user in. The API supports four different types of credential, which are all represented as subclasses of Credential
:
The guide page Credential types gives an overview of the different credential types and how they are used.
Interfaces
Credential
Provides information about an entity as a prerequisite to a trust decision.
CredentialsContainer
Exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out. This interface is accessible from navigator.credentials
.
FederatedCredential
Provides information about credentials from a federated identity provider, which is an entity that a website trusts to correctly authenticate a user, and which provides an API for that purpose. OpenID Connect is an example of such a framework.
PasswordCredential
Provides information about a username/password pair.
Extensions to other interfaces
Navigator.credentials
Read only
Returns the CredentialsContainer
interface which exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
Specifications
Browser compatibility
Desktop
Mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
WebView Android
PasswordCredential
51
79
No
38
No
51
No
41
No
5.0
51
Credential_Management_API
51
79
No
38
No
51
No
41
No
5.0
51
iconURL
51
79
No
38
No
51
No
41
No
5.0
51
name
51
79
No
38
No
51
No
41
No
5.0
51
password
60
79
No
47
No
60
No
44
No
8.0
60
Desktop
Mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
WebView Android
FederatedCredential
51
79
No
38
No
51
No
41
No
5.0
51
Credential_Management_API
51
79
No
38
No
51
No
41
No
5.0
51
iconURL
51
79
No
38
No
51
No
41
No
6.0
51
name
51
79
No
38
No
51
No
41
No
6.0
51
protocol
51
79
No
38
No
51
No
41
No
5.0
51
provider
51
79
No
38
No
51
No
41
No
5.0
51
Desktop
Mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
WebView Android
Credential_Management_API
51
18
60
38
13
51
60
41
13
5.0
51
create
60
18
60
47
13
60
60
44
13
8.0
60
get
51
18
60
38
13
51
60
41
13
5.0
51
preventSilentAccess
6051–60
18
60
4738–47
1713–17 This method exists, but always rejected with a NotSupportedError
exception.
6051–60
60
4441–44
1713–17 This method exists, but always rejected with a NotSupportedError
exception.
8.05.0–8.0
6051–60
store
51
79
60
38
13
51
60
41
13
5.0
51
Desktop
Mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
WebView Android
Credential_Management_API
51
18
60
38
13
51
60
41
13
5.0
51
id
51
18
60
38
13
51
60
41
13
5.0
51
isConditionalMediationAvailable_static
No
No
No
No
16
No
No
No
16
No
No
type
51
18
60
38
13
51
60
41
13
5.0
51
api.Credential
BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
api.CredentialsContainer
BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
api.FederatedCredential
BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
api.PasswordCredential
BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
See also