Authentication

Generate tokens to access other KLARA core endpoints

After obtaining tenant id and company id for the desired tenant, use this endpoint to get the access token for a specific tenant, and refresh token. <br />A grant_type of <strong>password</strong> is used for a Password grant, which requires username, password, tenant and company id to produce access token, refresh token from scratch.<br />A grant_type of <strong>refresh_token</strong> is used for a Refresh token grant, which is used for acquiring the access token using refresh token.<br />A grant_type of <strong>token_exchange</strong> performs an OAuth 2.0 Token Exchange (RFC 8693). Provide <strong>subject_token</strong> (the raw upstream Bearer token, without the 'Bearer ' prefix) and <strong>audience</strong> to identify the target token type.<br />Supported audience values:<ul><li><strong>cossa</strong> — exchanges a COSSA bearer token for a ePost access token.</li></ul><strong>Note:</strong> subject_token must be the raw token value without the 'Bearer ' prefix.

post/core/latest/token

Request

  • Base URL: https://api.klara.ch
  • URL: https://api.klara.ch/core/latest/token
  • Auth: none declared

Response

Token created

access_tokenstring

Token used to access KLARA Public API endpoints, should be place at Authorization header of request. Access token is valid only for one company tenant

expires_ininteger

Amount of time in seconds left that the access token is valid for

refresh_expires_ininteger

Amount of time in seconds left that the refresh token is valid for

refreshTokenstring

Token used to renew the access token

token_typestring

Type of access token that should be included in the Authorziation header of each request

Changes

No recorded changes to this operation across all 1 revision of this API.