# REST Resource: projects.locations.oauthClients

- [Resource: OauthClient](https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient)
  - [JSON representation](https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#State)
- [ClientType](https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#ClientType)
- [GrantType](https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#GrantType)
- [Methods](https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#METHODS_SUMMARY)

## Resource: OauthClient

Represents an `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. Used to access Google Cloud resources on behalf of a Workforce Identity Federation user by using OAuth 2.0 Protocol to obtain an access token from Google Cloud.

| JSON representation |
|---|
| ``` { "name": string, "state": enum (`https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#State`), "disabled": boolean, "clientId": string, "displayName": string, "description": string, "clientType": enum (`https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#ClientType`), "allowedGrantTypes": [ enum (`https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#GrantType`) ], "allowedScopes": [ string ], "allowedRedirectUris": [ string ], "expireTime": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Immutable. Identifier. The resource name of the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. Format:`projects/{project}/locations/{location}/oauthClients/{oauthClient}`. |
| `state` | ``enum (`https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#State`)`` Output only. The state of the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. |
| `disabled` | `boolean` Optional. Whether the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient` is disabled. You cannot use a disabled OAuth client. |
| `clientId` | `string` Output only. The system-generated `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient` id. |
| `displayName` | `string` Optional. A user-specified display name of the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. Cannot exceed 32 characters. |
| `description` | `string` Optional. A user-specified description of the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. Cannot exceed 256 characters. |
| `clientType` | ``enum (`https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#ClientType`)`` Immutable. The type of `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. Either public or private. For private clients, the client secret can be managed using the dedicated `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients.credentials#OauthClientCredential` resource. |
| `allowedGrantTypes[]` | ``enum (`https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#GrantType`)`` Required. The list of OAuth grant types is allowed for the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. |
| `allowedScopes[]` | `string` Required. The list of scopes that the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#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. |
| `allowedRedirectUris[]` | `string` Required. The list of redirect uris that is allowed to redirect back when authorization process is completed. |
| `expireTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time after which the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient` will be permanently purged and cannot be recovered. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## State

The current state of the `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Default value. This value is unused. |
| `ACTIVE` | The `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient` is active. |
| `DELETED` | The `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient` is soft-deleted. Soft-deleted `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient` is permanently deleted after approximately 30 days unless restored via `oauthClients.undelete`. |

## ClientType

The type of `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`.

| Enums ||
|---|---|
| `CLIENT_TYPE_UNSPECIFIED` | Should not be used. |
| `PUBLIC_CLIENT` | Public client has no secret. |
| `CONFIDENTIAL_CLIENT` | Private client. |

## GrantType

The OAuth grant type.

| Enums ||
|---|---|
| `GRANT_TYPE_UNSPECIFIED` | Should not be used. |
| `AUTHORIZATION_CODE_GRANT` | Authorization code grant. |
| `REFRESH_TOKEN_GRANT` | Refresh token grant. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients/create` | Creates a new `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. |
| ### `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients/delete` | Deletes an `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. |
| ### `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients/get` | Gets an individual `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. |
| ### `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients/list` | Lists all non-deleted `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`s in a project. |
| ### `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients/patch` | Updates an existing `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`. |
| ### `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients/undelete` | Undeletes an `https://docs.cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients#OauthClient`, as long as it was deleted fewer than 30 days ago. |