Tokens

Use tokens to facilitate authentication to the Run:ai API. The API server must be configured to use the Run:ai identity service to validate authentication tokens.

Create an application token.

Use to create application tokens. Select a token using the grant_type parameter.

SecuritybearerAuth
Request
header Parameters
User-Agent
string
Request Body schema: application/json
grantType
any
Enum: "app_token" "refresh_token" "exchange_token" "password"
appID
string
appSecret
string
code
string
redirectUri
string
refreshToken
string
username
string
password
string
clientID
string
Responses
200

Executed successfully.

400

Bad request.

500

unexpected error

503

unexpected error

post/api/v1/token
Request samples
application/json
{
  • "grantType": "app_token",
  • "appID": "string",
  • "appSecret": "string",
  • "code": "string",
  • "redirectUri": "string",
  • "refreshToken": "string",
  • "username": "string",
  • "password": "string",
  • "clientID": "string"
}
Response samples
application/json
{
  • "accessToken": "string",
  • "idToken": "string",
  • "refreshToken": "string",
  • "externalToken": "string"
}

exchange code for tokenDeprecated

Exchanges an authorization code for an access token. The authorization code is retrieved from the authorization server.

SecuritybearerAuth
Request
query Parameters
redirect_uri
required
string

The redirect uri to redirect to after the authorization server completes the authorization flow

code
required
string

The exchange code retrieved from the idp server

Responses
200

Executed successfully.

400

Bad request.

500

unexpected error

503

unexpected error

get/v1/k8s/auth/token/exchange
Response samples
application/json
{
  • "accessToken": "string",
  • "idToken": "string",
  • "refreshToken": "string",
  • "externalToken": "string"
}

refresh tokenDeprecated

Refreshes an user tokens. The refresh token is retrieved from the authorization server.

SecuritybearerAuth
Request
query Parameters
refresh_token
required
string

The refresh token retrieved from the idp server

Responses
200

Executed successfully.

400

Bad request.

500

unexpected error

503

unexpected error

post/v1/k8s/auth/oauth/tokens/refresh
Response samples
application/json
{
  • "accessToken": "string",
  • "idToken": "string",
  • "refreshToken": "string",
  • "externalToken": "string"
}

get application tokenDeprecated

Retrieve access token for an application. The application token is retrieved from the authorization server.

SecuritybearerAuth
Request
Request Body schema: application/json
id
required
string
name
required
string
secret
required
string
Responses
200

Executed successfully.

400

Bad request.

500

unexpected error

503

unexpected error

post/v1/k8s/auth/oauth/apptoken
Request samples
application/json
{
  • "id": "string",
  • "name": "string",
  • "secret": "string"
}
Response samples
application/json
{
  • "access_token": "string",
  • "id_token": "string"
}