{{APIRef("")}}{{SeeCompatTable}}
The get()
method of the {{domxref("CredentialsContainer")}} interface returns a {{jsxref("Promise")}} to a {{domxref("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.
Syntax
CredentialsContainer.get([options]).then(function(Credential) { ... })
Parameters
- options {{optional_inline}}
- An object that sets options to look for among the credentials in the {{domxref("CredentialsContainer")}}. The available options are:
password
: a {{jsxref("Boolean")}} indicating that returned {{domxref("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 {{domxref("DOMString")}} instances of identity providers to search for.protocols
n array of {{domxref("DOMString")}} instances of federation protocols to search for.
unmediated
: a {{jsxref("Boolean")}} indicating a returned {{domxref("Credential")}} instances should not require user mediation.
Returns
A {{jsxref("Promise")}} to a {{domxref("Credential")}} instance that matches the provided parameters.
Example
// TBD
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('Credential Management')}} | {{Spec2('Credential Management')}} | Initial definition. |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatChrome(51.0)}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatChrome(51.0)}} | {{CompatChrome(51.0)}} |