This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The get() method of the CredentialsContainer interface returns a Promise to a Credential instance that matches the provided parameters.

This method is restricted to top-level contexts. Calls to it within an <iframe> element will resolve without effect.


var promise = CredentialsContainer.get([options])


options Optional
An object that sets options to look for among the credentials in the CredentialsContainer. The available options are:
  • password: a Boolean indicating that returned Credential instances should include user (as opposed to federated) credentials.
  • federated: An object containing requirements for returned federated credentials. The available options are:
    • providers: An array of DOMString instances of identity providers to search for.
    • protocols An array of DOMString instances of federation protocols to search for.
  • mediation: A String indicating whether the user will be required to log on for every visit to the website. Valid values are "silent", "optional", or "required".
  • unmediated: A Boolean indicating the returned Credential instance should not require user mediation.


A Promise that resolves with a Credential instance that matches the provided parameters.


Specification Status Comment
Credential Management Level 1
The definition of 'get()' in that specification.
Editor's Draft Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 51 ? ? No support ?
options.mediation 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 ?
options.mediation 60 60 ? ? ? No support ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.