The Credential collection is a native collection of credential documents. A credential combines a document id and a password typically to uniquely identify a person, but credentials may also identify a service, system, or process that needs to run privileged queries in Fauna.

Except for documents in server native collections, any Fauna document can have a credential in this collection.

Fauna uses Credential to authenticate identities needing access to database resources. A successful Credential.login() method creates a corresponding Token document. Tokens work with roles to authorize resource access. Role documents control identity authorization by configuring the membership and privileges associated with database resources.

See the Credential document definition

Static methods

Method Description

Get all the identities.

Get a document credential.

Get a credential by its ID.

Create a credential.

Get the first credential matching a predicate function.

Get identities matching a predicate function.

Instance methods

Method Description

Delete a credential.

Test a credential exists.

Log in to Fauna.

Replace a credential.

Update a credential.

Password verification.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email

Thank you for your feedback!