Token
Learn: Tokens |
---|
A token is a type of authentication secret used to provide identity-based access to a Fauna database.
You typically create and use tokens as part of a Fauna-based end-user authentication system.
Token
collection
Fauna stores tokens as documents in the Token
system collection.
Token
documents have the following FQL structure:
{
id: "401671202234433613",
coll: Token,
ts: Time("2099-06-25T13:32:39.240Z"),
ttl: Time("2099-06-27T13:32:39.240Z"),
document: Customer("401670531121676365"),
secret: "fn..."
}
Field name | Value type | Read-only | Required | Description |
---|---|---|---|---|
|
ID for the IDs are assigned at document creation. To create a token with a user-provided
|
|||
|
true |
Collection name: |
||
|
true |
Last time the document was created or updated. |
||
|
Time-to-live (TTL) for the document. Only present if
set. If not present or set to |
|||
|
true |
The identity document associated with the token. |
||
|
Randomly generated cryptographic hash. Equivalent to a password. |
|||
|
Arbitrary user-defined metadata for the document. |
Static methods
You can use the following static methods to manage the Token
collection in
FQL.
Method | Description |
---|---|
Get a Set of all tokens. |
|
Get a token by its identity document. |
|
Get a token by its
document |
|
Create a token without a credential or related password. |
|
Get |
|