CredentialsContainer

The CredentialsContainer interface of 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. Available only in secure contexts.

MDN Reference

Functions

Link copied to clipboard

The create() method of the CredentialsContainer interface creates a new credential, which can then be stored and later retrieved using the navigator.credentials.get() method. The retrieved credential can then be used by a website to authenticate a user.

Link copied to clipboard
fun createAsync(options: CredentialCreationOptions = definedExternally): Promise<Credential?>

The create() method of the CredentialsContainer interface creates a new credential, which can then be stored and later retrieved using the navigator.credentials.get() method. The retrieved credential can then be used by a website to authenticate a user.

Link copied to clipboard

The get() method of the CredentialsContainer interface returns a Promise that fulfills with a single credential, which can then be used to authenticate a user to a website.

Link copied to clipboard
fun getAsync(options: CredentialRequestOptions = definedExternally): Promise<Credential?>

The get() method of the CredentialsContainer interface returns a Promise that fulfills with a single credential, which can then be used to authenticate a user to a website.

Link copied to clipboard

The preventSilentAccess() method of the CredentialsContainer interface sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns a Promise that resolves to undefined. For example, you might call this, after a user signs out of a website to ensure that they aren't automatically signed in on the next site visit. Mediation varies by origin, and is an added check point of browser stored credentials, informing a user of an account login status. This method is typically called after a user signs out of a website, ensuring this user's login information is not automatically passed on the next site visit.

Link copied to clipboard

The preventSilentAccess() method of the CredentialsContainer interface sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns a Promise that resolves to undefined. For example, you might call this, after a user signs out of a website to ensure that they aren't automatically signed in on the next site visit. Mediation varies by origin, and is an added check point of browser stored credentials, informing a user of an account login status. This method is typically called after a user signs out of a website, ensuring this user's login information is not automatically passed on the next site visit.

Link copied to clipboard
inline suspend fun CredentialsContainer.store(credential: Credential)

The store() method of the CredentialsContainer stores a set of credentials for the user inside a Credential instance, returning this in a Promise.

Link copied to clipboard
fun storeAsync(credential: Credential): Promise<Void?>

The store() method of the CredentialsContainer stores a set of credentials for the user inside a Credential instance, returning this in a Promise.