Authentication
XUND offers OAuth Client Credentials Flow for backend implementations.
To use it you will need a Client Id and an API key, that can be set up in the Client Hub. Authentication is performed by calling POST https://login.xund.solutions/api/token
endpoint.
Endpoint parameters
Parameter name | Parameter type | Parameter description |
---|---|---|
| constant | The requested grant type |
| string | The Client Id that belongs to the API key |
| string | The API key |
| string? – optional constant | Optional value required to use state parameter |
| string? – optional uuid | A valid uuid that can be used as an identifier on the client side (used in webhooks) |
Example request body:
{
grant_type: 'client_credentials',
clientId: '***',
clientSecret: '***'
}
Where clientSecret
is your raw API key. You will receive an access_token
in the response, that can be used in the authorization
header.
Example response body:
{
"access_token": "eyJhbGciOiJI...",
"token_type": "Bearer"
}
See an example implementation of this method here, under client_credentials
: https://github.com/XUND-Solutions-GmbH/backend-auth-flow-demo/blob/main/src/index.ts