- [HTTP request](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#body.aspect)
- [OAuthToken](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#OAuthToken)
  - [JSON representation](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#OAuthToken.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#try-it)

Pushes credentials to a running workstation on behalf of a user. Once complete, supported credential types (applicationDefaultCredentials) are made available to processes running in the user container.

### HTTP request

Choose an endpoint:
global asia-south1 europe-west6 us-central1 us-east1 us-east4 us-east5 us-west1 us-west4   
`POST https://workstations.googleapis.com/v1beta/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:pushCredentials`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `workstation` | `string` Required. Name of the workstation for which the credentials should be pushed. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "applicationDefaultCredentials": { object (`https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#OAuthToken`) } } ``` |

| Fields ||
|---|---|
| `applicationDefaultCredentials` | ``object (`https://docs.cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs.workstations/pushCredentials#OAuthToken`)`` Optional. Credentials used by Cloud Client Libraries, Google API Client Libraries, and other tooling within the user container. For more information, see <https://cloud.google.com/docs/authentication/application-default-credentials> |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/workstations/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## OAuthToken

Represents an OAuth 2.0 access token and its associated metadata.

| JSON representation |
|---|
| ``` { "email": string, "scopes": string, "accessToken": string, "expireTime": string, "expiresIn": string } ``` |

| Fields ||
|---|---|
| `email` | `string` Optional. The email address associated with the OAuth 2.0 access token. |
| `scopes` | `string` Optional. The scopes associated with the OAuth 2.0 access token. See <https://developers.google.com/identity/protocols/oauth2/scopes> for more information. |
| `accessToken` | `string` Required. The OAuth 2.0 access token value. |
| `expireTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. The time the OAuth access token will expire. This should be the time the access token was generated plus the expiresIn offset returned from the Access Token Response. Only one of `expireTime` or `expiresIn` should be specified. 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"`. |
| `expiresIn` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Optional. The lifetime duration of the access token. Only one of `expireTime` or `expiresIn` should be specified. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |