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: "401328088729780297",
  coll: Customer,
  ts: Time("2099-06-21T18:39:00.735Z"),
  firstName: "Alice",
  lastName: "Appleseed",
  email: "alice.appleseed@example.com",
  address: {
    street: "87856 Mendota Court",
    city: "Washington",
    state: "DC",
    zipCode: "20220"
  },
  telephone: "208-346-0715",
  creditCard: {
    network: "Visa",
    number: "4556781272473393"
  }
}

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!