Token.create()
Signature
Token.create(data: { id: ID | Null, document: { *: Any } | Null, ttl: Time | Null, data: { *: Any } | Null }) => Token
Description
Creates a token that’s tied to an identity document without a credential or related password. This method is useful for creating tokens for servers, services, and other non-user identities.
A token is a type of
authentication secret used to
provide identity-based access to a Fauna database. Fauna stores tokens as
documents in the Token
system
collection.
Create token with a credential
To create a token with a credential and related password, use
credential.login()
instead.
You typically use credential.login()
to create and
use tokens as part of a Fauna-based end-user
authentication system.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data |
Document fields for the new
For supported document fields, see
|
Return value
Type | Description |
---|---|
The new |