> For the complete documentation index, see [llms.txt](https://docs.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.collibra.com/data-quality-self-hosted/apis/rest/jwt.md).

# JWT

This section shows you how to use /auth/signin endpoints to generate JSON web tokens (JWTs) so you can run Collibra DQ CURL commands in your environment.

The endpoints that let you generate JWTs include the following:

* **/v3/auth/signin**
* **/v2/auth/signin**
* **/auth/signin**

{% hint style="success" %}
It is best practice to use the /v3/auth/signin endpoint to generate a JWT.
{% endhint %}

After you have a JWT, you can use it to authorize any API call in Collibra DQ, depending on your user-based role.

{% hint style="info" %}
JWT generated in Collibra DQ use a HMACSHA256 keyed hash algorithm.
{% endhint %}

## Single-tenant

To get a JWT to authorize calls in a single-tenant environment, execute the following request:

```
TOKEN=$(curl -s -X POST http://localhost:9000/auth/signin -H "Content-Type:application/json" -d "{\"username\":\"<username>\", \"password\":\"<password>\"}"| jq -r '.token')
 
curl -i -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://localhost:9000/v2/getsecuritymap
```

## Multi-tenant

To get a JWT to authorize calls in a multi-tenant environment, execute the following request without a sub-domain in the URL:

{% hint style="info" %}
The `iss` tenant parameter is required.
{% endhint %}

```
TOKEN=$(curl -s -X POST http://localhost:9000/auth/signin -H "Content-Type:application/json" -d "{\"username\":\"<username>\", \"password\":\"<password>\", \"iss\":\"<tenant>\"}"| jq -r '.token')
 
curl -i -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://localhost:9000/v2/getsecuritymap
```

## Without headers and jq display

```
curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://localhost:9000/v2/getsecuritymap | jq '.' | cat
```
