IAM (OAuth)
OAuth
Token
rpc Token (tetrateio.api.iam.v2.GrantRequest) returns (tetrateio.api.iam.v2.GrantResponse)
Grants tokens for a given grant type.
This is used by clients to obtain an access token by presenting required parameters for the requested grant type.
Current only "urn:ietf:params:oauth:grant-type:device_code" is supported.
When an error occurs, this will return a 4xx status code with an Error and ErrorMessage in the response.
TODO (lance) enable HTTP once proper unmarshalling from x-www-form-urlencoded can be supported
option(google.api.http) = {
post: "/v2/oauth/token"
};
DeviceCode
rpc DeviceCode (tetrateio.api.iam.v2.DeviceCodeRequest) returns (tetrateio.api.iam.v2.DeviceCodeResponse)
Requests device codes that can be used with a token grant with grant type "urn:ietf:params:oauth:grant-type:device_code".
For additional information please refer to the Device Authorization Grant RFC
https://datatracker.ietf.org/doc/html/rfc8628
TODO (lance) enable HTTP once proper unmarshalling from x-www-form-urlencoded can be supported
option(google.api.http) = {
post: "/v2/oauth/device/code"
};
DeviceCodeRequest
Request for devices codes.
Name | Number | Description |
DeviceCodeResponse
Response with device codes for use with the Device Authorization flow. For additional information on the response parameters please refer to the Device Authorization Response section of the RFC https://datatracker.ietf.org/doc/html/rfc8628#section-3.2
Field | Description | Validation Rule |
deviceCode | string | – |
userCode | string | – |
verificationUri | string | – |
interval | int32 | – |
expiresIn | int32 | – |
error | tetrateio.api.iam.v2.Error | – |
errorMessage | string | – |
Error
OAuth2 error codes
Name | Number | Description |
NO_ERROR | 0 | |
INVALID_REQUEST | 1 | |
INVALID_CLIENT | 2 | |
INVALID_GRANT | 3 | |
UNAUTHORIZED_CLIENT | 4 | |
UNSUPPORTED_GRANT_TYPE | 5 | |
AUTHORIZATION_PENDING | 6 | |
SLOW_DOWN | 7 | |
ACCESS_DENIED | 8 | |
EXPIRED_TOKEN | 9 | |
SERVER_ERROR | 10 |
GrantRequest
Token grant request.
Field | Description | Validation Rule |
grantType | tetrateio.api.iam.v2.GrantType | enum = { |
deviceCode | string | – |
refreshToken | string | – |
scope | List of string | – |
clientId | string | – |
resource | string | – |
subjectToken | string | – |
subjectTokenType | tetrateio.api.iam.v2.TokenType | – |
GrantResponse
Token grant response.
Field | Description | Validation Rule |
accessToken | string | – |
tokenType | string | – |
expiresIn | int32 | – |
refreshToken | string | – |
clientId | string | – |
error | tetrateio.api.iam.v2.Error | – |
errorMessage | string | – |
GrantType
OAuth2 grant types that are currently supported.
Name | Number | Description |
UNSPECIFIED | 0 | |
REFRESH_TOKEN | 1 | |
DEVICE_CODE_URN | 2 | |
CLIENT_CREDENTIALS | 3 | |
TOKEN_EXCHANGE | 4 |
TokenType
Name | Number | Description |
TOKEN_TYPE_UNSPECIFIED | 0 | |
TOKEN_TYPE_ACCESS_TOKEN | 1 | |
TOKEN_TYPE_REFRESH_TOKEN | 2 | |
TOKEN_TYPE_ID_TOKEN | 3 | |
TOKEN_TYPE_JWT | 4 |