Identify

Identify( identity, password )
Identify( identity, password )
Identify( identity, password )
Identify( identity, password )
identify( identity, password )
Identify( identity, password )

Description

The Identify function checks the given password against the identity's credentials, returning true if the credentials are valid, or false otherwise. An identity is a Ref for a document that has associated credentials.

Identify allows you to verify an identity’s credentials without calling the Login function and creating a new access token.

Parameters

Argument Type Definition and Requirements

identity

The identity whose credentials should be checked.

password

The password to check.

Returns

A boolean value indicating whether the password is valid for the specified identity.

Examples

client.Query(
  Identify(
    Ref(Collection("characters"), "181388642114077184"),
    "abracadabra"));
true
curl https://db.fauna.com/ \
    -u fnAChGwBcAACAO70ziE0cfROosNJHdgBmJU1PgpL: \
    -d '{
          "identify": { "@ref": "classes/characters/181388642114077184" },
          "password": "abracadabra"
        }'
HTTP/1.1 200 OK
{ "resource": true }
result, _ := client.Query(
    f.Identify(
        f.RefCollection(f.Collection("characters"), "181388642114077184"),
        "abracadabra",
    ),
)

fmt.Println(result)
true
System.out.println(
         client.query(
             Identify(
               Ref(Collection("characters"), Value(181388642114077184L)),
               Value("abracadabra")))
         .get());
true
client.query(
  q.Identify(
    q.Ref(q.Collection('characters'), '181388642114077184'),
    'abracadabra',
  )
)
.then((ret) => console.log(ret))
true
client.query(
  q.identify(
    q.ref(q.collection("characters"), "181388642114077184"),
    "abracadabra"
  ))
true
client.query(
  Identify(
    Ref(Collection("characters"), "181388642114077184"),
    "abracadabra"))
true

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve!
Visit Fauna's Discourse forums or email docs@fauna.com

Thank you for your feedback!