Authorization header with the value Bearer <token>:
Provisioning a token
Access tokens are short-lived and are generated from a long-lived refresh token. Generate the refresh token in Twine backoffice first, then exchange it for access tokens as needed. To obtain an access token:1
Begin the exchange
Invoke
/provisioning/refresh-token/begin using the JTI you received when provisioning the refresh token.2
Read the salt
The response contains a
salt value.3
Build the signature input
Concatenate the salt with the refresh token, separated by a colon (
:).4
Hash it
Hash the concatenated string using SHA256, for example
sha256 "<salt>:<refresh_token>". The hash must be in lower case.5
Refresh
Invoke
/provisioning/refresh-token/refresh with the JTI (as jti) and the hash (as signature) in the body.6
Receive the access token
The response contains an access token.