# Method: users.environments.authorize

- [HTTP request](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/authorize#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/authorize#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/authorize#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/authorize#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/authorize#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/authorize#body.aspect)
- [Try it!](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/authorize#try-it)

Sends OAuth credentials to a running environment on behalf of a user. When this completes, the environment will be authorized to run various Google Cloud command line tools without requiring the user to manually authenticate.

### HTTP request

`POST https://cloudshell.googleapis.com/v1/{name=users/*/environments/*}:authorize`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Name of the resource that should receive the credentials, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "accessToken": string, "idToken": string, "expireTime": string } ``` |

| Fields ||
|---|---|
| `accessToken` | `string` The OAuth access token that should be sent to the environment. |
| `idToken` | `string` The OAuth ID token that should be sent to the environment. |
| `expireTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The time when the credentials expire. If not set, defaults to one hour from when the server received the request. 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"`. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/shell/docs/reference/rest/v1/operations#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).