auth0.ClientGrant
Explore with Pulumi AI
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
Coming soon!```
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="python">
Coming soon!```
Coming soon!```
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="csharp">
Coming soon!```
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.auth0.Client;
import com.pulumi.auth0.ResourceServer;
import com.pulumi.auth0.ResourceServerArgs;
import com.pulumi.auth0.ClientGrant;
import com.pulumi.auth0.ClientGrantArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var myClient = new Client("myClient");
var myResourceServer = new ResourceServer("myResourceServer", ResourceServerArgs.builder()
.identifier("https://api.example.com/client-grant")
.scopes(
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
var myClientGrant = new ClientGrant("myClientGrant", ClientGrantArgs.builder()
.clientId(myClient.id())
.audience(myResourceServer.identifier())
.scopes(
"create:foo",
"create:bar")
.build());
}
}
resources:
# The following example grants a client the "create:foo" and "create:bar" permissions (scopes).
myClient:
type: auth0:Client
myResourceServer:
type: auth0:ResourceServer
properties:
identifier: https://api.example.com/client-grant
scopes:
- value: create:foo
description: Create foos
- value: create:bar
description: Create bars
myClientGrant:
type: auth0:ClientGrant
properties:
clientId: ${myClient.id}
audience: ${myResourceServer.identifier}
scopes:
- create:foo
- create:bar
Create ClientGrant Resource
new ClientGrant(name: string, args: ClientGrantArgs, opts?: CustomResourceOptions);
@overload
def ClientGrant(resource_name: str,
opts: Optional[ResourceOptions] = None,
audience: Optional[str] = None,
client_id: Optional[str] = None,
scopes: Optional[Sequence[str]] = None)
@overload
def ClientGrant(resource_name: str,
args: ClientGrantArgs,
opts: Optional[ResourceOptions] = None)
func NewClientGrant(ctx *Context, name string, args ClientGrantArgs, opts ...ResourceOption) (*ClientGrant, error)
public ClientGrant(string name, ClientGrantArgs args, CustomResourceOptions? opts = null)
public ClientGrant(String name, ClientGrantArgs args)
public ClientGrant(String name, ClientGrantArgs args, CustomResourceOptions options)
type: auth0:ClientGrant
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClientGrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ClientGrantArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ClientGrantArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClientGrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ClientGrantArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ClientGrant Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ClientGrant resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the ClientGrant resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ClientGrant Resource
Get an existing ClientGrant resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ClientGrantState, opts?: CustomResourceOptions): ClientGrant
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
audience: Optional[str] = None,
client_id: Optional[str] = None,
scopes: Optional[Sequence[str]] = None) -> ClientGrant
func GetClientGrant(ctx *Context, name string, id IDInput, state *ClientGrantState, opts ...ResourceOption) (*ClientGrant, error)
public static ClientGrant Get(string name, Input<string> id, ClientGrantState? state, CustomResourceOptions? opts = null)
public static ClientGrant get(String name, Output<String> id, ClientGrantState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
Import
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:
$ pulumi import auth0:index/clientGrant:ClientGrant my_client_grant "cgr_XXXXXXXXXXXXXXXX"
Package Details
- Repository
- Auth0 pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
auth0
Terraform Provider.