Task #1743
openEpic #1602: Auth API Integration
User Story #1618: Security API Integration
Implement Security API Integration for JWT Token Generation
0%
Description
Integrate the security endpoint for JWT token generation to support authenticated requests in the application. This API will generate a JWT token based on the provided username and return token details including expiry duration, userId, and username.
API Details:
Endpoint: POST /security/generate-token
Required Headers:
Content-Type: application/json
x-app-payload
x-app-signature
locale
x-app-version
x-platform
Request Body:
{
"username": "{{username}}"
}
Expected Response:
JWT token
username
userId
expiresIn
Scope of Work:
Create API client method for JWT token generation
Pass all required security headers
Send username in request body
Parse and store returned JWT token securely
Handle success and failure responses
Add logging for request/response debugging
Ensure token expiry information is available for session handling
Acceptance Criteria:
API is integrated successfully
JWT token is generated and parsed correctly
Token is stored securely for further authenticated requests
Error states are handled properly
Required headers are included in every request