oauth_clients
Creates, updates, deletes, gets or lists a oauth_clients
resource.
Overview
Name | oauth_clients |
Type | Resource |
Id | google.iam.oauth_clients |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Immutable. The resource name of the OauthClient. Format:projects/{project}/locations/{location}/oauthClients/{oauth_client} . |
description | string | Optional. A user-specified description of the OauthClient. Cannot exceed 256 characters. |
allowedGrantTypes | array | Required. The list of OAuth grant types is allowed for the OauthClient. |
allowedRedirectUris | array | Required. The list of redirect uris that is allowed to redirect back when authorization process is completed. |
allowedScopes | array | Required. 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. |
clientId | string | Output only. The system-generated OauthClient id. |
clientType | string | Immutable. The type of OauthClient. Either public or private. For private clients, the client secret can be managed using the dedicated OauthClientCredential resource. |
disabled | boolean | Optional. Whether the OauthClient is disabled. You cannot use a disabled OAuth client. |
displayName | string | Optional. A user-specified display name of the OauthClient. Cannot exceed 32 characters. |
expireTime | string | Output only. Time after which the OauthClient will be permanently purged and cannot be recovered. |
state | string | Output only. The state of the OauthClient. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | locationsId, oauthClientsId, projectsId | Gets an individual OauthClient. |
list | SELECT | locationsId, projectsId | Lists all non-deleted OauthClients in a project. If show_deleted is set to true , then deleted OauthClients are also listed. |
create | INSERT | locationsId, projectsId | Creates a new OauthClient. You cannot reuse the name of a deleted OauthClient until 30 days after deletion. |
delete | DELETE | locationsId, oauthClientsId, projectsId | 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. |
patch | UPDATE | locationsId, oauthClientsId, projectsId | Updates an existing OauthClient. |
undelete | EXEC | locationsId, oauthClientsId, projectsId | Undeletes 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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: state
value: string
- name: disabled
value: boolean
- name: clientId
value: string
- name: displayName
value: string
- name: description
value: string
- name: clientType
value: string
- name: allowedGrantTypes
value:
- string
- name: allowedScopes
value:
- string
- name: allowedRedirectUris
value:
- string
- name: expireTime
value: string
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 }}';