Method: projects.locations.workstationClusters.workstationConfigs.workstations.generateAccessToken

Returns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation. Once generated this token cannot be revoked and is good for the lifetime of the token.

HTTP request

POST https://workstations.googleapis.com/v1beta/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
workstation

string

Required. Name of the workstation for which the access token should be generated.

Request body

The request body contains data with the following structure:

JSON representation
{
  "port": integer,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "expireTime": string,
  "ttl": string
  // End of mutually exclusive fields.
}
Fields
port

integer

Optional. Port for which the access token should be generated. If specified, the generated access token grants access only to the specified port of the workstation. If specified, values must be within the range [1 - 65535]. If not specified, the generated access token grants access to all ports of the workstation.

Desired expiration or lifetime of the access token. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
expireTime

string (Timestamp format)

Desired expiration time of the access token. This value must be at most 24 hours in the future. If a value is not specified, the token's expiration time will be set to a default value of 1 hour in the future.

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".

ttl

string (Duration format)

Desired lifetime duration of the access token. This value must be at most 24 hours. If a value is not specified, the token's lifetime will be set to a default value of 1 hour.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

End of mutually exclusive fields.

Response body

Response message for workstations.generateAccessToken.

If successful, the response body contains data with the following structure:

JSON representation
{
  "accessToken": string,
  "expireTime": string
}
Fields
accessToken

string

The generated bearer access token. To use this token, include it in an Authorization header of an HTTP request sent to the associated workstation's hostname—for example, Authorization: Bearer <accessToken>.

expireTime

string (Timestamp format)

Time at which the generated token will expire.

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".

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.