---
description: >-
  This page details how to use the Authentication Controller's login endpoint to
  authenticate users and obtain Auth0 tokens for session management.
---

# Authentication

To authenticate, the user must provide a base token and credentials from Auth0. We assign the necessary permissions to ensure secure access to our APIs.

Bearer token to authenticate the user:&#x20;

```json
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InhJYTdTZDFKZThxU01ZaHY4WVhaYSJ9.eyJpc3MiOiJodHRwczovL2ZyZWVuYW1lLmV1LmF1dGgwLmNvbS8iLCJzdWIiOiJsS1hYa1FpS3hmRFdyTmUzYWtnSEFOQWxZS0tiTWNVMkBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMC8iLCJpYXQiOjE3NTQ2NDM5ODksImV4cCI6MTc1NzIzNTk4OSwic2NvcGUiOiJyZWFkIEFkbWluIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIiwiYXpwIjoibEtYWGtRaUt4ZkRXck5lM2FrZ0hBTkFsWUtLYk1jVTIiLCJwZXJtaXNzaW9ucyI6WyJyZWFkIiwiQWRtaW4iXX0.m3418MWdPJNt9o0EvihGTbl6Bxj4uzclytnwH6By7ry0SEQaZ7IcSKnBR4lxcnIX6h5HobAbEpI3_91Z8Ipv4HDu3CUeOT5xPZJESpHbInhX6JKiwA3hxL7_C-ND1UiDCRdyDWmK7d9_ao9QQp48vVVx5TiRBAT18zaTkZOkZPUY5SBhQ38geiIKCGIksPdHyP1LSUXjznKS0ALsFWvMC9-6jK_osCj2c3p84vKICTHMR9PB4FpL_l2gLNQk0ZO2UopfX5_39nBX3rb5LtAlvYEUwVEXsN6AS5D5klBoCPB4qKigtXKDJF9OELrSTMQn-1mHPwdcV-imY08AXVQ-MA
```

1. Log in with a given username and password.

To log in, users must first request an authorization token, which we provide upon initial request. With this authorization token, users can then request an access token. Upon successful authentication, an access token, refresh token, and ID token will be provided in the response. The access token is used for accessing other APIs, while the refresh token allows users to obtain a new access token without further interaction.

* **POST** `/api/v1/auth/login`

**Request Headers**

| **Name**     | **Description**                                                          |
| ------------ | ------------------------------------------------------------------------ |
| Bearer Token | \[**Required**] The first authorization token we provide for the log in. |

**Request**

```json
{
    "username": "your_username",
    "password": "password"
}
```

**Response**

**200 OK**

```json
{
    "access_token": "eyJhbGciOi...W5Aq_PT-aHS4zfDWKVdhTuIC081TfyW8A",
    "refresh_token": "iCBG8_QvW...17aUv5",
    "id_token": "eyJhbGciOiJSUzI1NiI...3BruaGMzqgc6N0OgnrLFpmsx4i8g",
    "scope": "openid profile email address phone offline_access",
    "expires_in": 2592000,
    "token_type": "Bearer"
}
```

2. Request a new access given the refresh token obtained during the log in.

To request a new access token using the refresh token obtained during login, send a request with the refresh token. Upon successful verification, a new access token and ID token will be provided in the response.

<table data-header-hidden><thead><tr><th width="193"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td><strong>Description</strong></td></tr><tr><td>Bearer Token</td><td>[<strong>Required</strong>] The access token can be used to renew and utilize the refresh token.</td></tr></tbody></table>

**Request**

```json
{
    "refreshToken": "iCBG8_QvWq1...mD917aUv5"
}
```

**Response**

```json
{
    "access_token": "eyJhbGciOiJSUzI1NiIsIn...opG2Of3PMT0wtmvad5JpFseBB_7ZmA",
    "id_token": "eyJhbGciOiJSUzI1NiIsInR...yJ4Wko-QM0Dkw",
    "scope": "openid profile email address phone offline_access",
    "expires_in": 2592000,
    "token_type": "Bearer"
}
```
