# User authentication (JWT Token)

## Get token

<mark style="color:green;">`POST`</mark> `https://muni-portal-backend.openup.org.za/api/token/`

Get access and refresh token for the user

#### Request Body

| Name     | Type   | Description   |
| -------- | ------ | ------------- |
| password | string | User password |
| username | string | User name     |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}
```
{
    "access": "JWT.ACCESS.TOKEN",
    "refresh": "JWT.REFRESH.TOKEN"
}
```
{% endtab %}

{% tab title="404 User not found" %}
```
```
{% endtab %}
{% endtabs %}



## Refresh access token

<mark style="color:green;">`POST`</mark> `https://muni-portal-backend.openup.org.za/api/token/refresh/`

Get new access token by refresh token

#### Path Parameters

| Name    | Type   | Description       |
| ------- | ------ | ----------------- |
| refresh | string | JWT refresh token |

{% tabs %}
{% tab title="200 " %}
```
{
    "access": "JWT.ACCESS.TOKEN",
    "refresh": "JWT.REFRESH.TOKEN"
}
```
{% endtab %}

{% tab title="400 " %}
```
```
{% endtab %}
{% endtabs %}
