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/v1/{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,

  // Union field expiration can be only one of the following:
  "expireTime": string,
  "ttl": string
  // End of list of possible types for union field expiration.
}
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.

Union field expiration. Desired expiration or lifetime of the access token. expiration can be only one of the following:
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.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

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

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.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.