Skip to main content

oauth_clients

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

Overview

Nameoauth_clients
TypeResource
Idgoogle.iam.oauth_clients

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. Identifier. The resource name of the OauthClient. Format:projects/{project}/locations/{location}/oauthClients/{oauth_client}.
allowedGrantTypesarrayRequired. The list of OAuth grant types is allowed for the OauthClient.
allowedRedirectUrisarrayRequired. The list of redirect uris that is allowed to redirect back when authorization process is completed.
allowedScopesarrayRequired. The list of scopes that the OauthClient is allowed to request during OAuth flows. The following scopes are supported: * https://www.googleapis.com/auth/cloud-platform: See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. * openid: The OAuth client can associate you with your personal information on Google Cloud. * email: The OAuth client can read a federated identity's email address. * groups: The OAuth client can read a federated identity's groups.
clientIdstringOutput only. The system-generated OauthClient id.
clientTypestringImmutable. The type of OauthClient. Either public or private. For private clients, the client secret can be managed using the dedicated OauthClientCredential resource.
descriptionstringOptional. A user-specified description of the OauthClient. Cannot exceed 256 characters.
disabledbooleanOptional. Whether the OauthClient is disabled. You cannot use a disabled OAuth client.
displayNamestringOptional. A user-specified display name of the OauthClient. Cannot exceed 32 characters.
expireTimestring (google-datetime)Output only. Time after which the OauthClient will be permanently purged and cannot be recovered.
statestringOutput only. The state of the OauthClient.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, oauthClientsIdGets an individual OauthClient.
listselectprojectsId, locationsIdpageSize, pageToken, showDeletedLists all non-deleted OauthClients in a project. If show_deleted is set to true, then deleted OauthClients are also listed.
createinsertprojectsId, locationsIdoauthClientIdCreates a new OauthClient. You cannot reuse the name of a deleted OauthClient until 30 days after deletion.
patchupdateprojectsId, locationsId, oauthClientsIdupdateMaskUpdates an existing OauthClient.
deletedeleteprojectsId, locationsId, oauthClientsIdDeletes an OauthClient. You cannot use a deleted OauthClient. However, deletion does not revoke access tokens that have already been issued. They continue to grant access. Deletion does revoke refresh tokens that have already been issued. They cannot be used to renew an access token. If the OauthClient is undeleted, and the refresh tokens are not expired, they are valid for token exchange again. You can undelete an OauthClient for 30 days. After 30 days, deletion is permanent. You cannot update deleted OauthClients. However, you can view and list them.
undeleteexecprojectsId, locationsId, oauthClientsIdUndeletes an OauthClient, as long as it was deleted fewer than 30 days ago.

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
locationsIdstring
oauthClientsIdstring
projectsIdstring
oauthClientIdstring
pageSizeinteger (int32)
pageTokenstring
showDeletedboolean
updateMaskstring (google-fieldmask)

SELECT examples

Gets an individual OauthClient.

SELECT
name,
allowedGrantTypes,
allowedRedirectUris,
allowedScopes,
clientId,
clientType,
description,
disabled,
displayName,
expireTime,
state
FROM google.iam.oauth_clients
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND oauthClientsId = '{{ oauthClientsId }}' -- required;

INSERT examples

Creates a new OauthClient. You cannot reuse the name of a deleted OauthClient until 30 days after deletion.

INSERT INTO google.iam.oauth_clients (
data__name,
data__disabled,
data__displayName,
data__description,
data__clientType,
data__allowedGrantTypes,
data__allowedScopes,
data__allowedRedirectUris,
projectsId,
locationsId,
oauthClientId
)
SELECT
'{{ name }}',
{{ disabled }},
'{{ displayName }}',
'{{ description }}',
'{{ clientType }}',
'{{ allowedGrantTypes }}',
'{{ allowedScopes }}',
'{{ allowedRedirectUris }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ oauthClientId }}'
RETURNING
name,
allowedGrantTypes,
allowedRedirectUris,
allowedScopes,
clientId,
clientType,
description,
disabled,
displayName,
expireTime,
state
;

UPDATE examples

Updates an existing OauthClient.

UPDATE google.iam.oauth_clients
SET
data__name = '{{ name }}',
data__disabled = {{ disabled }},
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__clientType = '{{ clientType }}',
data__allowedGrantTypes = '{{ allowedGrantTypes }}',
data__allowedScopes = '{{ allowedScopes }}',
data__allowedRedirectUris = '{{ allowedRedirectUris }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND oauthClientsId = '{{ oauthClientsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
allowedGrantTypes,
allowedRedirectUris,
allowedScopes,
clientId,
clientType,
description,
disabled,
displayName,
expireTime,
state;

DELETE examples

Deletes an OauthClient. You cannot use a deleted OauthClient. However, deletion does not revoke access tokens that have already been issued. They continue to grant access. Deletion does revoke refresh tokens that have already been issued. They cannot be used to renew an access token. If the OauthClient is undeleted, and the refresh tokens are not expired, they are valid for token exchange again. You can undelete an OauthClient for 30 days. After 30 days, deletion is permanent. You cannot update deleted OauthClients. However, you can view and list them.

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

Lifecycle Methods

Undeletes an OauthClient, as long as it was deleted fewer than 30 days ago.

EXEC google.iam.oauth_clients.undelete 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@oauthClientsId='{{ oauthClientsId }}' --required;