AccessProvider.byName()

Learn: Access providers

Gets an AccessProvider document by its name.

Signature

AccessProvider.byName(name: string) => AccessProvider | NullAccessProvider

Description

Gets the named AccessProvider document.

Staged schema

If a database has staged schema, this method interacts with the database’s staged schema, not the active schema.

Parameters

Parameter Type Required Description

name

String

Yes

Name of the access provider.

Return value

One of:

Type Description

AccessProvider

An access provider.

NullAccessProvider

Document doesn’t exist or is inaccessible. See NullDoc.

Examples

AccessProvider.byName("someIssuer")
{
  name: "someIssuer",
  coll: AccessProvider,
  ts: Time("2099-06-25T14:57:23.125Z"),
  roles: [
    "customer",
    {
      role: "manager",
      predicate: "(jwt) => jwt!.scope.includes(\"manager\")"
    }
  ],
  issuer: "https://example.com/",
  jwks_uri: "https://example.com/.well-known/jwks.json",
  audience: "https://db.fauna.com/db/ysjowue14yyr1"
}

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!