Query.identity()

Learn: Attribute-based access control (ABAC)

Get the authentication token’s identity document.

Signature

Query.identity(): Any | Null

Description

The identity() method gets the identity document for the query’s authentication token.

You can call identity() in role-related predicates used for attribute-based access control (ABAC).

For JWTs and keys, the method returns null. JWTs and keys aren’t tied to an identity document.

Parameters

None

Return value

One of:

Type Description

Any

Identity document for the authentication token.

Null

null: No identity document is associated with the authentication secret.

Examples

Query.identity()
{
  id: "371264255805095970",
  coll: People,
  ts: Time("2023-07-25T22:27:15.410Z"),
  name: "Alice Jones",
  email: "ajones@gmail.com"
}

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!