Resource: auth0_client_grant

Auth0 uses various grant types, or methods by which you grant limited access to your resources to another entity without exposing credentials. The OAuth 2.0 protocol supports several types of grants, which allow different types of access. This resource allows you to create and manage client grants used with configured Auth0 clients.

Example Usage

# The following example grants a client the "create:foo" and "create:bar" permissions (scopes).

resource "auth0_client" "my_client" {
  name = "Example Application - Client Grant (Managed by Terraform)"
}

resource "auth0_resource_server" "my_resource_server" {
  name       = "Example Resource Server - Client Grant (Managed by Terraform)"
  identifier = "https://api.example.com/client-grant"

  scopes {
    value       = "create:foo"
    description = "Create foos"
  }

  scopes {
    value       = "create:bar"
    description = "Create bars"
  }
}

resource "auth0_client_grant" "my_client_grant" {
  client_id = auth0_client.my_client.id
  audience  = auth0_resource_server.my_resource_server.identifier
  scopes    = ["create:foo", "create:bar"]
}

Schema

Required

Read-Only

Import

Import is supported using the following syntax:

# This resource can be imported by specifying the client grant ID.
# You can find this within the Management Dashboard in Application -> APIs -> Expand the required API.
#
# Example:
terraform import auth0_client_grant.my_client_grant "cgr_XXXXXXXXXXXXXXXX"