AccessProvider
Learn: Access providers |
---|
We recommend you use FSL to create and update access providers. See FSL access provider schema. |
An access provider registers an external identity provider (IdP), such as Auth0, in your Fauna database.
Once set up, the IdP can issue JSON Web Tokens (JWTs) that act as Fauna authentication secrets. This lets your application’s end users use the IdP for authentication.
AccessProvider
collection
Fauna stores access providers as documents in the AccessProvider
system
collection. These documents are an FQL version of the FSL
access provider schema.
AccessProvider
documents have the following FQL structure:
{
name: "someIssuer",
coll: AccessProvider,
ts: Time("2099-09-06T21:46:50.272Z"),
roles: [
"customer",
{
role: "manager",
predicate: "(jwt) => jwt!.scope.includes(\"manager\")"
}
],
jwks_uri: "https://example.com/.well-known/jwks.json",
audience: "https://db.fauna.com/db/ysij4khxoynr4",
data: {
desc: "Access provider for issuer"
},
issuer: "https://example.com/"
}
Field | Type | Read-only | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Unique name for the access provider in the database. Must begin with a letter. Can only include letters, numbers, and underscores. |
|||||||||||
|
true |
The document’s collection. For access providers, this value is
|
||||||||||
|
true |
Document last changed timestamp. Updated only on document write. |
||||||||||
|
User-defined roles assigned to JWTs issued by the IdP. Can’t be built-in roles. A
|
|||||||||||
|
URI that points to public JSON web key sets (JWKS) for JWTs issued by the IdP. Fauna uses the keys to verify each JWT’s signature. |
|||||||||||
|
true |
Globally unique URL for the Fauna database.
Must match the |
||||||||||
|
Arbitrary user-defined metadata for the provider. |
|||||||||||
|
Issuer for the IdP’s JWTs. Must match the |
Static methods
You can use the following static methods to manage the AccessProvider
collection in FQL.
Method | Description |
---|---|
Get the Set of all access providers. |
|
Get an access provider by its name. |
|
Create an access provider. |
|
Get the first provider matching a predicate function. |
|
Get the name of the AccessProvider collection as a string. |
|
Get providers matching a predicate function. |
Instance methods
You can use the following instance methods to manage specific AccessProvider
documents in FQL.
Method | Description |
---|---|
Delete an access provider. |
|
Tests if an access provider exists. |
|
Replace an access provider. |
|
Update an access provider. |
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!