Skip to main content

oauth_client_credentials

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

Overview​

Nameoauth_client_credentials
TypeResource
Idgoogle.iam.oauth_client_credentials

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. Identifier. The resource name of the OauthClientCredential. Format: projects/{project}/locations/{location}/oauthClients/{oauth_client}/credentials/{credential}
clientSecretstringOutput only. The system-generated OAuth client secret. The client secret must be stored securely. If the client secret is leaked, you must delete and re-create the client credential. To learn more, see OAuth client and credential security risks and mitigations
disabledbooleanOptional. Whether the OauthClientCredential is disabled. You cannot use a disabled OauthClientCredential.
displayNamestringOptional. A user-specified display name of the OauthClientCredential. Cannot exceed 32 characters.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, oauthClientsId, credentialsIdGets an individual OauthClientCredential.
listselectprojectsId, locationsId, oauthClientsIdLists all OauthClientCredentials in an OauthClient.
createinsertprojectsId, locationsId, oauthClientsIdoauthClientCredentialIdCreates a new OauthClientCredential.
patchupdateprojectsId, locationsId, oauthClientsId, credentialsIdupdateMaskUpdates an existing OauthClientCredential.
deletedeleteprojectsId, locationsId, oauthClientsId, credentialsIdDeletes an OauthClientCredential. Before deleting an OauthClientCredential, it should first be disabled.

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
credentialsIdstring
locationsIdstring
oauthClientsIdstring
projectsIdstring
oauthClientCredentialIdstring
updateMaskstring (google-fieldmask)

SELECT examples​

Gets an individual OauthClientCredential.

SELECT
name,
clientSecret,
disabled,
displayName
FROM google.iam.oauth_client_credentials
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND oauthClientsId = '{{ oauthClientsId }}' -- required
AND credentialsId = '{{ credentialsId }}' -- required
;

INSERT examples​

Creates a new OauthClientCredential.

INSERT INTO google.iam.oauth_client_credentials (
data__disabled,
data__displayName,
data__name,
projectsId,
locationsId,
oauthClientsId,
oauthClientCredentialId
)
SELECT
{{ disabled }},
'{{ displayName }}',
'{{ name }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ oauthClientsId }}',
'{{ oauthClientCredentialId }}'
RETURNING
name,
clientSecret,
disabled,
displayName
;

UPDATE examples​

Updates an existing OauthClientCredential.

UPDATE google.iam.oauth_client_credentials
SET
data__disabled = {{ disabled }},
data__displayName = '{{ displayName }}',
data__name = '{{ name }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND oauthClientsId = '{{ oauthClientsId }}' --required
AND credentialsId = '{{ credentialsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
clientSecret,
disabled,
displayName;

DELETE examples​

Deletes an OauthClientCredential. Before deleting an OauthClientCredential, it should first be disabled.

DELETE FROM google.iam.oauth_client_credentials
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND oauthClientsId = '{{ oauthClientsId }}' --required
AND credentialsId = '{{ credentialsId }}' --required
;