Check out v4 of the Fauna CLI
v4 of the Fauna CLI is now in beta. The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start. |
Credential
Learn: Credentials |
---|
A credential associates a password with an identity document. You can use the credential and password to create an authentication token for an end user, system, or other identity.
Credential
collection
Fauna stores credentials as documents in the Credential
system
collection. You can also access this collection using the Credentials
alias.
Credential
documents have the following FQL structure:
{
id: "401328088768577609",
coll: Credential,
ts: Time("2099-06-21T18:39:00.735Z"),
document: Customer("401328088729780297")
password: "sekret"
data: {
desc: "Credential for VIP customer"
}
}
Field name | Type | Read-only | Required | Description |
---|---|---|---|---|
|
ID for the IDs are assigned at document creation. To create a credential with a
user-provided |
|||
|
true |
Collection name: |
||
|
true |
Last time the document was created or updated. |
||
|
Ref< |
true |
Reference to the credential’s identity document. The identity document can be in any user-defined collection. |
|
|
End-user password to associate with the credential’s identity document. Only provided when creating, replacing, or updating a credential. You can use the password to generate a token for the credential using
Passwords are not returned in |
|||
|
|
Arbitrary user-defined metadata for the document. |
Static methods
You can use the following static methods to manage the Credential
collection in FQL.
Method | Description |
---|---|
Get a Set of all credentials. |
|
Get a credential by its identity document. |
|
Get a credential by its
document |
|
Create a credential. |
|
Get the first credential that matches a provided predicate. |
|
Get |
|
Get a Set of credentials that match a provided predicate. |
Instance methods
You can use the following instance methods to manage specific Credential
documents in FQL.
Method | Description |
---|---|
Delete a credential. |
|
Test if a credential exists. |
|
Create a token for a provided credential and its password. |
|
Replace a credential. |
|
Update a credential. |
|
Test whether a provided password is valid for a credential. |
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!