Authentication Callback
This endpoint receives authentication data from your login system after a customer successfully authenticates.Base URL
All API endpoints use the following base URL:POST 
{api_base_url}/api/v1/lab/login/callback/You must authenticate this request using your API key from the platform settings.
Header
Request Body
The authentication token for the customer. This token will be used by Sate to make authenticated requests to your functions.
The expiration time of the authentication token as a Unix timestamp in seconds.
The state parameter that was included in the original login URL. This is used to match the authentication response with the correct session.
Example Request
Response
Success Response
Returns HTTP status200 when the authentication is processed successfully:
Error Responses
Returns HTTP status400 or 403 with error details when there are issues:
Status Codes
Authentication token processed successfully
Missing required parameters, invalid data format, or validation errors
Authentication failed or access denied
Security Considerations
Always validate the state parameter to ensure the authentication response corresponds to a legitimate login request initiated by your system.
Store minimal information in tokens and implement proper token rotation and revocation mechanisms.
Best Practices
- API Key Security: Store your API key securely and never expose it in client-side code
 - Validate State: Always verify the state parameter matches an active login session
 - Token Security: Use secure token generation and storage practices
 - Expiration: Set appropriate token expiration times
 - HTTPS Only: Ensure all communication uses HTTPS
 - Error Handling: Implement proper error handling and logging
 
Testing the Integration
Using cURL
Testing Checklist
- Callback endpoint accepts all required parameters
 - State parameter validation works correctly
 - Token expiration is handled properly
 - Error responses are returned for invalid requests
 - HTTPS is enforced for all requests