Skip to main content

client_roles

Creates, updates, deletes, gets or lists a client_roles resource.

Overview

Nameclient_roles
TypeResource
Idokta.oauth2.client_roles

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_roles_for_clientselectsubdomainLists all roles assigned to a client app identified by clientId
retrieve_client_roleselectsubdomainRetrieves a role assignment (identified by roleAssignmentId) for a client app (identified by clientId)
assign_role_to_clientinsertsubdomainAssigns a standard role to a client app.

You can also assign a custom role to a client app, but the preferred method to assign a custom role to a client is to create a binding between the custom role, the resource set, and the client app. See Create a role resource set binding.

> Notes:
> * The request payload is different for standard and custom role assignments.
> * For IAM-based standard role assignments, use the request payload for standard roles. However, the response payload for IAM-based role assignments is similar to the custom role's assignment response.
delete_role_from_clientdeletesubdomainUnassigns a role assignment (identified by roleAssignmentId) from a client app (identified by clientId)

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)

SELECT examples

Lists all roles assigned to a client app identified by clientId

SELECT
*
FROM okta.oauth2.client_roles
WHERE subdomain = '{{ subdomain }}' -- required
;

INSERT examples

Assigns a standard role to a client app.

You can also assign a custom role to a client app, but the preferred method to assign a custom role to a client is to create a binding between the custom role, the resource set, and the client app. See Create a role resource set binding.

> Notes:
> * The request payload is different for standard and custom role assignments.
> * For IAM-based standard role assignments, use the request payload for standard roles. However, the response payload for IAM-based role assignments is similar to the custom role's assignment response.

INSERT INTO okta.oauth2.client_roles (
subdomain
)
SELECT
'{{ subdomain }}'
;

DELETE examples

Unassigns a role assignment (identified by roleAssignmentId) from a client app (identified by clientId)

DELETE FROM okta.oauth2.client_roles
WHERE subdomain = '{{ subdomain }}' --required
;