Authenticates a user with email and password credentials and returns a JWT access token for subsequent API requests.
Request
This endpoint uses OAuth2 password flow with form data.
User’s email address (used as username in OAuth2 flow)
OAuth2 grant type (typically “password”)
OAuth2 client ID (optional)
OAuth2 client secret (optional)
Response
JWT access token for authenticating subsequent requests
Token type, always returns “bearer”
curl -X POST "https://api.vidaplus.com/auth/token/" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "[email protected]&password=securepassword123"
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyQGV4YW1wbGUuY29tIiwiZXhwIjoxNzA5ODI0ODAwfQ.abc123def456",
"token_type": "bearer"
}
Usage
After obtaining the access token, include it in the Authorization header for subsequent API requests:
Authorization: Bearer <access_token>
Token Details
- Algorithm: JWT (JSON Web Token)
- Expiration: Tokens expire based on the server’s
ACCESS_TOKEN_EXPIRE_MINUTES configuration
- Subject: The token’s
sub claim contains the user’s email address
- Refresh: Use the Refresh Token endpoint to obtain a new access token before expiration
Error Responses
| Status Code | Description |
|---|
| 200 | Successful authentication, returns access token |
| 401 | Invalid credentials (incorrect email or password) |
| 422 | Validation error (missing or invalid request fields) |