# Entity Auth Token (Deprecated)

### Environment

<table><thead><tr><th width="218">Environment</th><th>Token Service (OLD) Base URL</th></tr></thead><tbody><tr><td>Saafe Hackathon</td><td><code>https://tokens.sandbox.sahamati.org.in</code></td></tr><tr><td>Saafe Sandbox</td><td><code>https://uattokens.sahamati.org.in</code></td></tr></tbody></table>

### API Request

<mark style="color:green;">`POST`</mark> `{{Token Service Base URL}}/auth/realms/sahamati/protocol/openid-connect/token`

#### Request <a href="#request" id="request"></a>

**Authorization Basic Auth**

<table data-header-hidden><thead><tr><th width="254"></th><th></th></tr></thead><tbody><tr><td>Username</td><td>client id - Obtained in <a href="create-fiu-entity">Create FIU Entity</a></td></tr><tr><td>Password</td><td>client secret - Obtained in <a href="create-fiu-entity">Create FIU Entity</a></td></tr></tbody></table>

**Body**

| **Key**     | **Value**           |
| ----------- | ------------------- |
| grant\_type | client\_credentials |
| scope       | openid              |

#### Response <a href="#response" id="response"></a>

```json
{
    "access_token": "string",
    "expires_in": 86400,
    "refresh_expires_in": 0,
    "token_type": "Bearer",
    "id_token": "string",
    "not-before-policy": 0,
    "scope": "openid email microprofile-jwt profile address phone offline_access"
}
```

**Note:** **access\_token** in the above response needs to be used as **client\_api\_key** in the header of the API calls made to the AA
