# Auth

## Auth Token

> Generate JWT token for authentication

```json
{"openapi":"3.0.3","info":{"title":"PDC Public API (v2)","version":"v2"},"servers":[{"url":"/"}],"paths":{"/api/public/v2/auth":{"post":{"summary":"Auth Token","tags":["Auth"],"description":"Generate JWT token for authentication","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"username":{"type":"string","default":""},"password":{"type":"string","default":"","format":"password"},"client_id":{"type":"string","default":"pdc-client"},"grant_type":{"type":"string","default":"password"},"scope":{"type":"string","default":"openid profile email"}},"required":["username","password","client_id","grant_type","scope"],"additionalProperties":false,"description":"Request body for authentication"}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","default":"OK"},"data":{"type":"object","properties":{"accessToken":{"type":"string","description":"JWT access token"}},"required":["accessToken"]}},"required":["message","data"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"description":"Bad Request","type":"object","properties":{"status":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array"},{"type":"object","additionalProperties":true}]}}}}}},"401":{"description":"Unauthorized - The request requires a valid Bearer token.\n\n    \tTo access this endpoint:\n\n        1. Make a POST request to /api/public/v1/auth with valid credentials to obtain the access token.\n        2. Click the \"Authorize\" button in the Swagger UI and enter the token.\n        3. All protected endpoints require the Authorization header: \"Authorization: 'Bearer your-access-token'\"\n    ","content":{"application/json":{"schema":{"description":"Unauthorized - The request requires a valid Bearer token.\n\n    \tTo access this endpoint:\n\n        1. Make a POST request to /api/public/v1/auth with valid credentials to obtain the access token.\n        2. Click the \"Authorize\" button in the Swagger UI and enter the token.\n        3. All protected endpoints require the Authorization header: \"Authorization: 'Bearer your-access-token'\"\n    ","type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"description":"Internal Server Error","type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}}}},"503":{"description":"Service Unavailable — Connection Refused","content":{"application/json":{"schema":{"description":"Service Unavailable — Connection Refused","type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}}}}}}}}}
```
