AccessProvider.create()
Create an AccessProvider.
Description
The create()
method creates an AccessProvider
document based on the data
object settings. The provider document controls access to the current database
by a third-party identity provider (IdP), such as Auth0.
After an AccessProvider
document is created and your IdP is configured,
callers can authenticate using the IdP service, then
access Fauna resources as configured by the document.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data |
Object describing the access provider. |
data fields
Name | Type | Required | Description |
---|---|---|---|
name |
Yes |
Unique access provider name. |
|
issuer |
Unique IdP HTTPS URL that you are using to grant access to
Fauna. This value is typically an account or application URL supplied
by your IdP. Use an exact copy of your IdP |
||
jwks_uri |
Valid HTTPS URI, which serves the JSON Web Key (JWK) that signs the JSON Web Token (JWT) from the IdP. |
||
roles |
Roles array or Role-predicate
Roles to evaluate to validate JWT token access.
No privileges are defined if |
||
data |
User-defined |
Return value
An object with metadata for the results of the create()
call.
Type | Description |
---|---|
New access provider. |
Examples
{
name: "anAccessProvider",
coll: AccessProvider,
ts: Time("2023-07-28T03:46:30.150Z"),
audience: "https://db.fauna.com/db/ywtfhw4poyynr",
data: {
custom: "some data"
},
roles: [
"mgmtTeam",
{
role: "mgmtTeam",
predicate: "_ => true"
}
],
jwks_uri: "https://fauna.auth0.com/.well-known/jwks.json",
issuer: "https://fauna.auth0.com"
}
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!