Credential.create()
Learn: Credentials |
---|
Create a credential.
Description
The Credential.create()
method creates a
credential.
A credential associates a password with an identity document.
You can use credentials to create tokens as part of an end-user authentication system.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data |
Yes |
Object describing the credential. |
data fields
Name | Type | Required | Description |
---|---|---|---|
document |
Yes |
Identity document. Must be in a user-defined collection. Tokens created using the credential are tied to this document. An identity document can only have one credential. |
|
password |
Password associated with the credential. Typically an end user’s password. |
Return value
Type | Description |
---|---|
Document in the |
Examples
{
id: "373081348103995425",
coll: Credential,
ts: Time("2023-08-14T23:49:09.650Z"),
document: People.byId("372696914650464289")
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!