Skip to main content

o_auth_client_credentials

Creates, updates, deletes, gets or lists an o_auth_client_credentials resource.

Overview​

Nameo_auth_client_credentials
TypeResource
Idoci.identity.o_auth_client_credentials

Fields​

The following fields are returned by SELECT queries:

User can define Oauth clients in IAM, then use it to generate a token to grant access to app resources.<br />

NameDatatypeDescription
idstringThe OCID of the Oauth credential.
namestringThe name of the Oauth credential.
compartmentIdstringThe OCID of the compartment containing the Oauth credential.
descriptionstringThe description of the Oauth credential.
expiresOnstring (date-time)Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
lifecycleStatestringThe credential's current state. After creating a Oauth credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it. (CREATING, ACTIVE, INACTIVE, DELETING, DELETED)
scopesarrayAllowed scopes for the given oauth credential.
timeCreatedstring (date-time)Date and time the OAuth2ClientCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
userIdstringThe OCID of the user the Oauth credential belongs to.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectuserId, regionpage, limit, lifecycleStateList of Oauth tokens for the user<br />
createinsertuserId, region, name, description, scopesopc-retry-tokenCreates Oauth token for the user<br />
updateupdateuserId, oauth2ClientCredentialId, region, description, scopes, passwordResetif-matchUpdates Oauth token for the user<br />
deletedeleteuserId, oauth2ClientCredentialId, regionif-matchDelete Oauth token for the user<br />

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
oauth2ClientCredentialIdstringThe ID of the Oauth credential.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
userIdstringThe OCID of the user.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
lifecycleStatestringA filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
limitintegerThe maximum number of items to return in a paginated "List" call.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringThe value of the opc-next-page response header from the previous "List" call.

SELECT examples​

List of Oauth tokens for the user<br />

SELECT
id,
name,
compartmentId,
description,
expiresOn,
lifecycleState,
scopes,
timeCreated,
userId
FROM oci.identity.o_auth_client_credentials
WHERE userId = '{{ userId }}' -- required
AND region = '{{ region }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND lifecycleState = '{{ lifecycleState }}'
;

INSERT examples​

Creates Oauth token for the user<br />

INSERT INTO oci.identity.o_auth_client_credentials (
description,
name,
scopes,
userId,
region,
opc-retry-token
)
SELECT
'{{ description }}' /* required */,
'{{ name }}' /* required */,
'{{ scopes }}' /* required */,
'{{ userId }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
name,
compartmentId,
description,
expiresOn,
lifecycleState,
password,
scopes,
timeCreated,
userId
;

UPDATE examples​

Updates Oauth token for the user<br />

UPDATE oci.identity.o_auth_client_credentials
SET
description = '{{ description }}',
isResetPassword = {{ isResetPassword }},
scopes = '{{ scopes }}'
WHERE
userId = '{{ userId }}' --required
AND oauth2ClientCredentialId = '{{ oauth2ClientCredentialId }}' --required
AND region = '{{ region }}' --required
AND description = '{{ description }}' --required
AND scopes = '{{ scopes }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
name,
compartmentId,
description,
expiresOn,
lifecycleState,
password,
scopes,
timeCreated,
userId;

DELETE examples​

Delete Oauth token for the user<br />

DELETE FROM oci.identity.o_auth_client_credentials
WHERE userId = '{{ userId }}' --required
AND oauth2ClientCredentialId = '{{ oauth2ClientCredentialId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;