create method
The create()
method of the CredentialsContainer interface returns
a Promise
that resolves with a new credential instance based on the
provided options, the information from which can then be stored and later
used to authenticate users via CredentialsContainer.get.
This is used by multiple different credential-related APIs with significantly different purposes:
- The
Credential Management API
uses
create()
to create basic federated credentials or username/password credentials. - The
Web Authentication API
uses
create()
to create public key credentials (based on asymmetric cryptography).
The below reference page starts with a syntax section that explains the general method call structure and parameters that apply to all the different APIs. After that, it is split into separate sections providing parameters, return values, and examples specific to each API.
Note: This method is restricted to top-level (i.e., a document running directly inside a browser tab, and not embedded inside another document). Calls to it from within an
<iframe>
element will resolve without effect.
Implementation
external JSPromise<Credential?> create([CredentialCreationOptions options]);