AccessProvider

AccessProvider( name )
AccessProvider( name )
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

Parameter Type Definition and Requirements

name

The name of the 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":

try
{
    Value result = await client.Query(
        AccessProvider("Auth0-myapp")
    );

    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
RefV(id = "Auth0-myapp", collection = RefV(id = "access_providers"))
result, err := client.Query(
	f.AccessProvider("Auth0-myapp"))

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
{Auth0-myapp 0xc000113710 0xc000113710 <nil>}
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] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
AccessProvider("Auth0-myapp")
result = client.query(
  q.access_provider("Auth0-myapp")
)
print(result)
Ref(id=Auth0-myapp, collection=Ref(id=access_providers))
AccessProvider('Auth0-myapp')
AccessProvider("Auth0-myapp")
Query metrics:
  •    bytesIn:  33

  •   bytesOut:  90

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:  67

  • writeBytes:   0

  •  queryTime: 7ms

  •    retries:   0

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

try
{
    Value result = await client.Query(
        Get(AccessProvider("Auth0-myapp"))
    );

    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
ObjectV(ref: RefV(id = "Auth0-myapp", collection = RefV(id = "access_providers")),ts: LongV(1617396518670000),name: StringV(Auth0-myapp),issuer: StringV(https://myapp.auth0.com/),jwks_uri: StringV(https://myapp.auth0.com/.well-known/jwks.json),audience: StringV(https://db.fauna.com/db/yomidtog6ybyy))
result, err := client.Query(
	f.Get(f.AccessProvider("Auth0-myapp")))

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
map[audience:https://db.fauna.com/db/yomidxp6nydyy issuer:https://myapp.auth0.com/ jwks_uri:https://myapp.auth0.com/.well-known/jwks.json name:Auth0-myapp ref:{Auth0-myapp 0xc000182270 0xc000182270 <nil>} ts:1617396484800000]
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] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
{
  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'}
Get(AccessProvider('Auth0-myapp'))
{
  ref: AccessProvider("Auth0-myapp"),
  ts: 1624310322260000,
  name: 'Auth0-myapp',
  issuer: 'https://myapp.auth0.com/',
  jwks_uri: 'https://myapp.auth0.com/.well-known/jwks.json',
  audience: 'https://db.fauna.com/db/yoatg11a4ybyy'
}
Query metrics:
  •    bytesIn:  41

  •   bytesOut: 287

  • computeOps:   1

  •    readOps:   1

  •   writeOps:   0

  •  readBytes: 222

  • writeBytes:   0

  •  queryTime: 6ms

  •    retries:   0

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!