> For the complete documentation index, see [llms.txt](https://docs.lsports.eu/u/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lsports.eu/u/trade/combo-builder/authentication.md). Agents can also search and read this documentation through its [MCP server](https://docs.lsports.eu/u/~gitbook/mcp).

# Authentication

These steps are intended for TRADE customers (technical users) to authenticate against ComboBuilder services using API credentials.

Before proceeding, make sure you have your **Client ID** and **Secret Key**. If you don't have them yet, follow the [API Token Generation Guide](https://docs.lsports.eu/u/trade/user-guide/configuration/user-avatar/api-token-generation.md) first.

1. **Exchange API Credentials for Access & Refresh Tokens**
   * **Endpoint**:

     `POST` [`https://authentication.lsports.eu/identity/resources/auth/v1/api-token`](https://authentication.lsports.eu/identity/resources/auth/v1/api-token)
   * **Headers**:

     `Content-Type: application/json`
   * **Body**:

     `{ "clientId": "<Client ID>", "secret": "<Secret Key>" }`
   * **Response**:

     `{ "expires": "<Thu, 22 May 2025 11:49:22 GMT>", "expiresIn": 1800, "accessToken": "<JWT access token>", "refreshToken": "<Refresh token>" }`
   * **Notes**:
     * accessToken `expiresIn` = 30 minutes.
     * `refreshToken` lives for 7 days.
2. **Refresh the Access Token**
   * **Endpoint**:

     `POST` [`https://authentication.lsports.eu/identity/resources/auth/v2/api-token/token/refresh`](https://authentication.lsports.eu/identity/resources/auth/v2/api-token/token/refresh)
   * **Headers**:

     `Content-Type: application/json`
   * **Body**:

     `{ "refreshToken": "<Previous refreshToken>" }`
   * **Response**:

     `{ "expires": "<Thu, 22 May 2025 11:49:22 GMT>", "expiresIn": 1800, "accessToken": "<JWT access token>", "refreshToken": "<Refresh token>" }`
3. **Use the Access Token**

   For every API call to ComboBuilder backend services, include the latest `accessToken` in the `Authorization` header:

   `Authorization: Bearer <accessToken>`

Remember, the accessToken expires every 30 minutes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lsports.eu/u/trade/combo-builder/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
