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 |
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 |
Fields | |
---|---|
port |
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: |
|
expire |
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: |
ttl |
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 ' |
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 | |
---|---|
access |
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, |
expire |
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: |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.