# Verify authentication

`POST /lokta-lms/api/v1/authentication`

Authenticates the credentials provided and returns the set roles and permissions allowed.

## Request body (application/json)
- `password` (string, required)
- `username` (string, required)

## Responses
- `200`: OK
- `400`: Unauthenticated. Please login
- `403`: Password reset required

## Response fields
- `authenticated` (boolean)
- `base64EncodedAuthenticationKey` (string)
- `officeId` (integer)
- `officeName` (string)
- `organisationalRole` (EnumOptionData)
- `permissions` (array)
- `roles` (array of RoleData)
- `staffDisplayName` (string)
- `staffId` (integer)
- `userId` (integer)
- `username` (string)

## Example request (cURL)
```bash
curl -X POST \
  'http://localhost:8080/lokta-lms/api/v1/authentication' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "password": "password",
  "username": "admin"
}'
```

## Example response
```json
{
  "authenticated": true,
  "base64EncodedAuthenticationKey": "bWlmb3M6cGFzc3dvcmQ=",
  "officeId": 1,
  "officeName": "Head Office"
}
```

Interactive: https://developer.lokta.ai/reference.html#operation/authenticate
