Session-based login (Legacy)
const url = 'https://auth.timetonic.com/login';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"hello@example.com","userId":"example","password":"example","authCode":"example","redirect":"https://example.com","oidc_request_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://auth.timetonic.com/login \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com", "userId": "example", "password": "example", "authCode": "example", "redirect": "https://example.com", "oidc_request_id": "example" }'Authenticate user with credentials using web session. Returns JWT token for API access and handles pass-through parameters. Supports 2FA via authCode parameter and can return a pre-auth setup challenge when policy enforces enrollment.
Request Bodyrequired
Section intitulée « Request Bodyrequired »object
User email (required if userId not provided)
User identifier (required if email not provided)
2FA code if required
URL to redirect after login
Pending OIDC authorization request to resume after login or enforced 2FA setup
Examplegenerated
{ "email": "hello@example.com", "userId": "example", "password": "example", "authCode": "example", "redirect": "https://example.com", "oidc_request_id": "example"}Responses
Section intitulée « Responses »Login successful
object
JWT access token
Refresh token
object
Redirect URL with token appended
HTML form body returned when OIDC response_mode is form_post
Parameters stored from initial bootstrap
object
Whether user must change password
Token for password change (if mustChangePassword is true)
Password policies for change form
object
Whether 2FA setup is enforced by policy
2FA setup data if setup is required
object
Example
{ "success": true}Authentication failed
object
Example
{ "success": false}2FA setup required before login can complete
object
Example
{ "success": false, "error": "2fa_setup_required", "2fa_setup_required": true}Validation error
object
object
Example
{ "success": false, "error": "validation_error", "message": "The given data was invalid", "errors": { "email": [ "The email field is required." ] }}