Terraform: configure API grants for machine-to-machine client

I would like to configure a machine-to-machine client via terraform.
I can create the client but am unclear on how to connect it to an API - especially the //us.auth0.com/api/v2/// api and configure the grants.

Is this possible, can you please provide an example or some hints on how to approach it?

I’m using the auth0/auth0 terraform provider.

Thank you!

1 Like

I think I worked it out.
I was a bit confused to what the audience refers to.

resource "auth0_client" "user_management" {
  name        = var.client_name
  description = var.client_description
  app_type    = "non_interactive"
}

resource "auth0_client_grant" "user_management_grant" {
  audience  = var.grant_audience
  client_id = auth0_client.ike_office_user_management.client_id
  scope     = var.grant_scope
}

2 Likes

Perfect! Thanks for sharing it with the rest of community!