AccessProvider

Not available in this language, yet.
Not available in this language, yet.
AccessProvider( name )
AccessProvider( name )
access_provider( name )
AccessProvider( name )

Description

The AccessProvider function returns a valid Reference for the specified AccessProvider name in the specified child database. If a child database is not specified, the returned AccessProvider reference belongs to the current database.

Parameters

Argument Type Definition and Requirements

name

The name of an AccessProvider.

Returns

A reference to an AccessProvider with the specified name, in the specified child database (or the current database if database is not specified).

Examples

The following query gets a reference to the AccessProvider named "Auth0-myapp":

Not available in this language, yet.
Not available in this language, yet.
System.out.println(
    client.query(
        AccessProvider("Auth0-myapp")
    ).get());
ref(id = "Auth0-myapp", collection = ref(id = "access_providers"))
client.query(
  q.AccessProvider('Auth0-myapp')
)
.then((ret) => console.log(ret))
.catch((err) => console.error('Error: %s', err))
AccessProvider("Auth0-myapp")
result = client.query(
  q.access_provider("Auth0-myapp")
)
print(result)
Ref(id=Auth0-myapp, collection=Ref(id=access_providers))
try {
  println(Await.result(
    client.query(AccessProvider("Auth0-myapp")),
    5.seconds
  ))
} catch {
  case unknown: Throwable => println("Error: " + unknown.getMessage())
}
ref(id = "Auth0-myapp", collection = ref(id = "access_providers"))

The following query retrieves the "Auth0-myapp" AccessProvider document:

Not available in this language, yet.
Not available in this language, yet.
System.out.println(
    client.query(
        Get(AccessProvider("Auth0-myapp"))
    ).get());
{ref: ref(id = "Auth0-myapp", collection = ref(id = "access_providers")), ts: 1611251241360000, name: "Auth0-myapp", issuer: "https://myapp.auth0.com/", jwks_uri: "https://myapp.auth0.com/.well-known/jwks.json", audience: "https://db.fauna.com/db/yoyg4mtm4ydyy"}
client.query(
  q.Get(q.AccessProvider('Auth0-myapp'))
)
.then((ret) => console.log(ret))
.catch((err) => console.error('Error: %s', err))
{
  ref: AccessProvider("Auth0-myapp"),
  ts: 1605546537710000,
  name: 'Auth0-myapp',
  issuer: 'https://myapp.auth0.com/',
  jwks_uri: 'https://myapp.auth0.com/.well-known/jwks.json',
  audience: 'https://db.fauna.com/db/yxi13oyw1ybyy'
}
result = client.query(
  q.get(q.access_provider("Auth0-myapp"))
)
print(result)
{'ref': Ref(id=Auth0-myapp, collection=Ref(id=access_providers)), 'ts': 1611251241360000, 'name': 'Auth0-myapp', 'issuer': 'https://myapp.auth0.com/', 'jwks_uri': 'https://myapp.auth0.com/.well-known/jwks.json', 'audience': 'https://db.fauna.com/db/yoyg4mtm4ydyy'}
try {
  println(Await.result(
    client.query(Get(AccessProvider("Auth0-myapp"))),
    5.seconds
  ))
} catch {
  case unknown: Throwable => println("Error: " + unknown.getMessage())
}
{name: "Auth0-myapp", ts: 1611251241360000, audience: "https://db.fauna.com/db/yoyg4mtm4ydyy", issuer: "https://myapp.auth0.com/", ref: ref(id = "Auth0-myapp", collection = ref(id = "access_providers")), jwks_uri: "https://myapp.auth0.com/.well-known/jwks.json"}

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!