Harthelm Docs

Redeem an approved CLI sign-in

Works without credentials; the `code_verifier` is the proof. `202` while nobody approved yet (poll again after `interval` seconds); `200` once, with a new API key of the approving user (source `cli`, name from the start request); afterwards, and after a denial or the expiry, `409 cli-login-closed`. A wrong verifier is `404`, like an unknown sign-in.

Generated from openapi/harthelm.yaml at v1.5.0
POST
/cli/logins/{login}/token

Path Parameters

login*string

A CLI sign-in's id from POST /cli/logins.

Formatuuid

Request Body

application/json
  1. body
code_verifier*string
Match^[A-Za-z0-9._~-]{43,128}$

Response Body

The new API key.

application/json
  1. response
token*string

hart_<id>_<secret>, shown this once.

api_key*

A personal API key without its secret.

user*
curl -X POST 'https://console.example.com/api/v1/cli/logins/497f6eca-6276-4993-bfeb-53cbbbba6f08/token' \  -H 'Content-Type: application/json' \  -d '{  "code_verifier": "string"}'
{  "token": "string",  "api_key": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "source": "console",    "prefix": "string",    "created_at": "2019-08-24T14:15:22Z",    "regenerated_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z"  },  "user": {    "id": 1,    "email": "string",    "name": "string",    "is_cluster_admin": true,    "email_verified": true,    "picture_url": "string",    "issuer": "string"  }}