1. Packages
  2. Keycloak
  3. API Docs
  4. openid
  5. ClientPermissions
Keycloak v5.3.2 published on Friday, May 10, 2024 by Pulumi

keycloak.openid.ClientPermissions

Explore with Pulumi AI

keycloak logo
Keycloak v5.3.2 published on Friday, May 10, 2024 by Pulumi

    Allows you to manage all openid client Scope Based Permissions.

    This is part of a preview keycloak feature. You need to enable this feature to be able to use this resource. More information about enabling the preview feature can be found here: https://www.keycloak.org/docs/latest/securing_apps/index.html#_token-exchange

    When enabling Openid Client Permissions, Keycloak does several things automatically:

    1. Enable Authorization on build-in realm-management client
    2. Create scopes “view”, “manage”, “configure”, “map-roles”, “map-roles-client-scope”, “map-roles-composite”, " token-exchange"
    3. Create a resource representing the openid client
    4. Create all scope based permission for the scopes and openid client resource

    If the realm-management Authorization is not enable, you have to ceate a dependency (depends_on) with the policy and the openid client.

    Create ClientPermissions Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClientPermissions(name: string, args: ClientPermissionsArgs, opts?: CustomResourceOptions);
    @overload
    def ClientPermissions(resource_name: str,
                          args: ClientPermissionsArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClientPermissions(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          client_id: Optional[str] = None,
                          realm_id: Optional[str] = None,
                          configure_scope: Optional[ClientPermissionsConfigureScopeArgs] = None,
                          manage_scope: Optional[ClientPermissionsManageScopeArgs] = None,
                          map_roles_client_scope_scope: Optional[ClientPermissionsMapRolesClientScopeScopeArgs] = None,
                          map_roles_composite_scope: Optional[ClientPermissionsMapRolesCompositeScopeArgs] = None,
                          map_roles_scope: Optional[ClientPermissionsMapRolesScopeArgs] = None,
                          token_exchange_scope: Optional[ClientPermissionsTokenExchangeScopeArgs] = None,
                          view_scope: Optional[ClientPermissionsViewScopeArgs] = None)
    func NewClientPermissions(ctx *Context, name string, args ClientPermissionsArgs, opts ...ResourceOption) (*ClientPermissions, error)
    public ClientPermissions(string name, ClientPermissionsArgs args, CustomResourceOptions? opts = null)
    public ClientPermissions(String name, ClientPermissionsArgs args)
    public ClientPermissions(String name, ClientPermissionsArgs args, CustomResourceOptions options)
    
    type: keycloak:openid:ClientPermissions
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ClientPermissionsArgs
    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 ClientPermissionsArgs
    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 ClientPermissionsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClientPermissionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClientPermissionsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var clientPermissionsResource = new Keycloak.OpenId.ClientPermissions("clientPermissionsResource", new()
    {
        ClientId = "string",
        RealmId = "string",
        ConfigureScope = new Keycloak.OpenId.Inputs.ClientPermissionsConfigureScopeArgs
        {
            DecisionStrategy = "string",
            Description = "string",
            Policies = new[]
            {
                "string",
            },
        },
        ManageScope = new Keycloak.OpenId.Inputs.ClientPermissionsManageScopeArgs
        {
            DecisionStrategy = "string",
            Description = "string",
            Policies = new[]
            {
                "string",
            },
        },
        MapRolesClientScopeScope = new Keycloak.OpenId.Inputs.ClientPermissionsMapRolesClientScopeScopeArgs
        {
            DecisionStrategy = "string",
            Description = "string",
            Policies = new[]
            {
                "string",
            },
        },
        MapRolesCompositeScope = new Keycloak.OpenId.Inputs.ClientPermissionsMapRolesCompositeScopeArgs
        {
            DecisionStrategy = "string",
            Description = "string",
            Policies = new[]
            {
                "string",
            },
        },
        MapRolesScope = new Keycloak.OpenId.Inputs.ClientPermissionsMapRolesScopeArgs
        {
            DecisionStrategy = "string",
            Description = "string",
            Policies = new[]
            {
                "string",
            },
        },
        TokenExchangeScope = new Keycloak.OpenId.Inputs.ClientPermissionsTokenExchangeScopeArgs
        {
            DecisionStrategy = "string",
            Description = "string",
            Policies = new[]
            {
                "string",
            },
        },
        ViewScope = new Keycloak.OpenId.Inputs.ClientPermissionsViewScopeArgs
        {
            DecisionStrategy = "string",
            Description = "string",
            Policies = new[]
            {
                "string",
            },
        },
    });
    
    example, err := openid.NewClientPermissions(ctx, "clientPermissionsResource", &openid.ClientPermissionsArgs{
    	ClientId: pulumi.String("string"),
    	RealmId:  pulumi.String("string"),
    	ConfigureScope: &openid.ClientPermissionsConfigureScopeArgs{
    		DecisionStrategy: pulumi.String("string"),
    		Description:      pulumi.String("string"),
    		Policies: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	ManageScope: &openid.ClientPermissionsManageScopeArgs{
    		DecisionStrategy: pulumi.String("string"),
    		Description:      pulumi.String("string"),
    		Policies: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	MapRolesClientScopeScope: &openid.ClientPermissionsMapRolesClientScopeScopeArgs{
    		DecisionStrategy: pulumi.String("string"),
    		Description:      pulumi.String("string"),
    		Policies: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	MapRolesCompositeScope: &openid.ClientPermissionsMapRolesCompositeScopeArgs{
    		DecisionStrategy: pulumi.String("string"),
    		Description:      pulumi.String("string"),
    		Policies: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	MapRolesScope: &openid.ClientPermissionsMapRolesScopeArgs{
    		DecisionStrategy: pulumi.String("string"),
    		Description:      pulumi.String("string"),
    		Policies: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	TokenExchangeScope: &openid.ClientPermissionsTokenExchangeScopeArgs{
    		DecisionStrategy: pulumi.String("string"),
    		Description:      pulumi.String("string"),
    		Policies: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	ViewScope: &openid.ClientPermissionsViewScopeArgs{
    		DecisionStrategy: pulumi.String("string"),
    		Description:      pulumi.String("string"),
    		Policies: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    })
    
    var clientPermissionsResource = new ClientPermissions("clientPermissionsResource", ClientPermissionsArgs.builder()
        .clientId("string")
        .realmId("string")
        .configureScope(ClientPermissionsConfigureScopeArgs.builder()
            .decisionStrategy("string")
            .description("string")
            .policies("string")
            .build())
        .manageScope(ClientPermissionsManageScopeArgs.builder()
            .decisionStrategy("string")
            .description("string")
            .policies("string")
            .build())
        .mapRolesClientScopeScope(ClientPermissionsMapRolesClientScopeScopeArgs.builder()
            .decisionStrategy("string")
            .description("string")
            .policies("string")
            .build())
        .mapRolesCompositeScope(ClientPermissionsMapRolesCompositeScopeArgs.builder()
            .decisionStrategy("string")
            .description("string")
            .policies("string")
            .build())
        .mapRolesScope(ClientPermissionsMapRolesScopeArgs.builder()
            .decisionStrategy("string")
            .description("string")
            .policies("string")
            .build())
        .tokenExchangeScope(ClientPermissionsTokenExchangeScopeArgs.builder()
            .decisionStrategy("string")
            .description("string")
            .policies("string")
            .build())
        .viewScope(ClientPermissionsViewScopeArgs.builder()
            .decisionStrategy("string")
            .description("string")
            .policies("string")
            .build())
        .build());
    
    client_permissions_resource = keycloak.openid.ClientPermissions("clientPermissionsResource",
        client_id="string",
        realm_id="string",
        configure_scope=keycloak.openid.ClientPermissionsConfigureScopeArgs(
            decision_strategy="string",
            description="string",
            policies=["string"],
        ),
        manage_scope=keycloak.openid.ClientPermissionsManageScopeArgs(
            decision_strategy="string",
            description="string",
            policies=["string"],
        ),
        map_roles_client_scope_scope=keycloak.openid.ClientPermissionsMapRolesClientScopeScopeArgs(
            decision_strategy="string",
            description="string",
            policies=["string"],
        ),
        map_roles_composite_scope=keycloak.openid.ClientPermissionsMapRolesCompositeScopeArgs(
            decision_strategy="string",
            description="string",
            policies=["string"],
        ),
        map_roles_scope=keycloak.openid.ClientPermissionsMapRolesScopeArgs(
            decision_strategy="string",
            description="string",
            policies=["string"],
        ),
        token_exchange_scope=keycloak.openid.ClientPermissionsTokenExchangeScopeArgs(
            decision_strategy="string",
            description="string",
            policies=["string"],
        ),
        view_scope=keycloak.openid.ClientPermissionsViewScopeArgs(
            decision_strategy="string",
            description="string",
            policies=["string"],
        ))
    
    const clientPermissionsResource = new keycloak.openid.ClientPermissions("clientPermissionsResource", {
        clientId: "string",
        realmId: "string",
        configureScope: {
            decisionStrategy: "string",
            description: "string",
            policies: ["string"],
        },
        manageScope: {
            decisionStrategy: "string",
            description: "string",
            policies: ["string"],
        },
        mapRolesClientScopeScope: {
            decisionStrategy: "string",
            description: "string",
            policies: ["string"],
        },
        mapRolesCompositeScope: {
            decisionStrategy: "string",
            description: "string",
            policies: ["string"],
        },
        mapRolesScope: {
            decisionStrategy: "string",
            description: "string",
            policies: ["string"],
        },
        tokenExchangeScope: {
            decisionStrategy: "string",
            description: "string",
            policies: ["string"],
        },
        viewScope: {
            decisionStrategy: "string",
            description: "string",
            policies: ["string"],
        },
    });
    
    type: keycloak:openid:ClientPermissions
    properties:
        clientId: string
        configureScope:
            decisionStrategy: string
            description: string
            policies:
                - string
        manageScope:
            decisionStrategy: string
            description: string
            policies:
                - string
        mapRolesClientScopeScope:
            decisionStrategy: string
            description: string
            policies:
                - string
        mapRolesCompositeScope:
            decisionStrategy: string
            description: string
            policies:
                - string
        mapRolesScope:
            decisionStrategy: string
            description: string
            policies:
                - string
        realmId: string
        tokenExchangeScope:
            decisionStrategy: string
            description: string
            policies:
                - string
        viewScope:
            decisionStrategy: string
            description: string
            policies:
                - string
    

    ClientPermissions 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 ClientPermissions resource accepts the following input properties:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClientPermissions resource produces the following output properties:

    AuthorizationResourceServerId string
    Resource server id representing the realm management client on which this permission is managed
    Enabled bool
    Id string
    The provider-assigned unique ID for this managed resource.
    AuthorizationResourceServerId string
    Resource server id representing the realm management client on which this permission is managed
    Enabled bool
    Id string
    The provider-assigned unique ID for this managed resource.
    authorizationResourceServerId String
    Resource server id representing the realm management client on which this permission is managed
    enabled Boolean
    id String
    The provider-assigned unique ID for this managed resource.
    authorizationResourceServerId string
    Resource server id representing the realm management client on which this permission is managed
    enabled boolean
    id string
    The provider-assigned unique ID for this managed resource.
    authorization_resource_server_id str
    Resource server id representing the realm management client on which this permission is managed
    enabled bool
    id str
    The provider-assigned unique ID for this managed resource.
    authorizationResourceServerId String
    Resource server id representing the realm management client on which this permission is managed
    enabled Boolean
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ClientPermissions Resource

    Get an existing ClientPermissions 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?: ClientPermissionsState, opts?: CustomResourceOptions): ClientPermissions
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            authorization_resource_server_id: Optional[str] = None,
            client_id: Optional[str] = None,
            configure_scope: Optional[ClientPermissionsConfigureScopeArgs] = None,
            enabled: Optional[bool] = None,
            manage_scope: Optional[ClientPermissionsManageScopeArgs] = None,
            map_roles_client_scope_scope: Optional[ClientPermissionsMapRolesClientScopeScopeArgs] = None,
            map_roles_composite_scope: Optional[ClientPermissionsMapRolesCompositeScopeArgs] = None,
            map_roles_scope: Optional[ClientPermissionsMapRolesScopeArgs] = None,
            realm_id: Optional[str] = None,
            token_exchange_scope: Optional[ClientPermissionsTokenExchangeScopeArgs] = None,
            view_scope: Optional[ClientPermissionsViewScopeArgs] = None) -> ClientPermissions
    func GetClientPermissions(ctx *Context, name string, id IDInput, state *ClientPermissionsState, opts ...ResourceOption) (*ClientPermissions, error)
    public static ClientPermissions Get(string name, Input<string> id, ClientPermissionsState? state, CustomResourceOptions? opts = null)
    public static ClientPermissions get(String name, Output<String> id, ClientPermissionsState 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.
    The following state arguments are supported:

    Supporting Types

    ClientPermissionsConfigureScope, ClientPermissionsConfigureScopeArgs

    DecisionStrategy string
    Description string
    Policies List<string>
    decisionStrategy String
    description String
    policies List<String>
    decisionStrategy String
    description String
    policies List<String>

    ClientPermissionsManageScope, ClientPermissionsManageScopeArgs

    DecisionStrategy string
    Description string
    Policies List<string>
    decisionStrategy String
    description String
    policies List<String>
    decisionStrategy String
    description String
    policies List<String>

    ClientPermissionsMapRolesClientScopeScope, ClientPermissionsMapRolesClientScopeScopeArgs

    DecisionStrategy string
    Description string
    Policies List<string>
    decisionStrategy String
    description String
    policies List<String>
    decisionStrategy String
    description String
    policies List<String>

    ClientPermissionsMapRolesCompositeScope, ClientPermissionsMapRolesCompositeScopeArgs

    DecisionStrategy string
    Description string
    Policies List<string>
    decisionStrategy String
    description String
    policies List<String>
    decisionStrategy String
    description String
    policies List<String>

    ClientPermissionsMapRolesScope, ClientPermissionsMapRolesScopeArgs

    DecisionStrategy string
    Description string
    Policies List<string>
    decisionStrategy String
    description String
    policies List<String>
    decisionStrategy String
    description String
    policies List<String>

    ClientPermissionsTokenExchangeScope, ClientPermissionsTokenExchangeScopeArgs

    DecisionStrategy string
    Description string
    Policies List<string>
    decisionStrategy String
    description String
    policies List<String>
    decisionStrategy String
    description String
    policies List<String>

    ClientPermissionsViewScope, ClientPermissionsViewScopeArgs

    DecisionStrategy string
    Description string
    Policies List<string>
    decisionStrategy String
    description String
    policies List<String>
    decisionStrategy String
    description String
    policies List<String>

    Package Details

    Repository
    Keycloak pulumi/pulumi-keycloak
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the keycloak Terraform Provider.
    keycloak logo
    Keycloak v5.3.2 published on Friday, May 10, 2024 by Pulumi