Skip to main content

oauth_clients

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

Overview

Nameoauth_clients
TypeResource
Idgoogle.iam.oauth_clients

Fields

NameDatatypeDescription
namestringImmutable. The resource name of the OauthClient. Format:projects/{project}/locations/{location}/oauthClients/{oauth_client}.
descriptionstringOptional. A user-specified description of the OauthClient. Cannot exceed 256 characters.
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.
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.
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.
expireTimestringOutput only. Time after which the OauthClient will be permanently purged and cannot be recovered.
statestringOutput only. The state of the OauthClient.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, oauthClientsId, projectsIdGets an individual OauthClient.
listSELECTlocationsId, projectsIdLists all non-deleted OauthClients in a project. If show_deleted is set to true, then deleted OauthClients are also listed.
createINSERTlocationsId, projectsIdCreates a new OauthClient. You cannot reuse the name of a deleted OauthClient until 30 days after deletion.
deleteDELETElocationsId, oauthClientsId, projectsIdDeletes 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.
patchUPDATElocationsId, oauthClientsId, projectsIdUpdates an existing OauthClient.
undeleteEXEClocationsId, oauthClientsId, projectsIdUndeletes an OauthClient, as long as it was deleted fewer than 30 days ago.

SELECT examples

Lists all non-deleted OauthClients in a project. If show_deleted is set to true, then deleted OauthClients are also listed.

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

INSERT example

Use the following StackQL query and manifest file to create a new oauth_clients resource.

/*+ create */
INSERT INTO google.iam.oauth_clients (
locationsId,
projectsId,
name,
disabled,
displayName,
description,
clientType,
allowedGrantTypes,
allowedScopes,
allowedRedirectUris
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
{{ disabled }},
'{{ displayName }}',
'{{ description }}',
'{{ clientType }}',
'{{ allowedGrantTypes }}',
'{{ allowedScopes }}',
'{{ allowedRedirectUris }}'
;

UPDATE example

Updates a oauth_clients resource.

/*+ update */
UPDATE google.iam.oauth_clients
SET
name = '{{ name }}',
disabled = true|false,
displayName = '{{ displayName }}',
description = '{{ description }}',
clientType = '{{ clientType }}',
allowedGrantTypes = '{{ allowedGrantTypes }}',
allowedScopes = '{{ allowedScopes }}',
allowedRedirectUris = '{{ allowedRedirectUris }}'
WHERE
locationsId = '{{ locationsId }}'
AND oauthClientsId = '{{ oauthClientsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified oauth_clients resource.

/*+ delete */
DELETE FROM google.iam.oauth_clients
WHERE locationsId = '{{ locationsId }}'
AND oauthClientsId = '{{ oauthClientsId }}'
AND projectsId = '{{ projectsId }}';