Authentication

Tarasol uses a multi-layered authentication system built on JWT tokens with support for SSO, delegation, and service-to-service authentication.

Token Types

Token TypeDurationPurpose
Access Token1 hourAPI request authorization
Refresh Token7 daysAccess token renewal
S2S TokenConfigurableService-to-service auth
OTP Token5 minutesOne-time password verification

Authentication Flow

Authentication Flow

Loading diagram...

Token Refresh

When an access token expires, the client can use the refresh token to obtain a new pair:

POST
/api/identity/refresh-token

Exchange a valid refresh token for new access + refresh tokens

SSO Integration (OpenAM)

Tarasol supports Single Sign-On via OpenAM:

  1. Client redirects to OpenAM login page
  2. OpenAM authenticates and redirects back with SSO token
  3. Identity Service validates SSO token with OpenAM
  4. JWT tokens issued for the authenticated user

Delegation

The delegation system allows users to grant their permissions to other users temporarily:

  • Delegation Created — Admin service publishes notify.delegation_created.requested
  • Delegation Cancelled — Admin service publishes notify.delegation_cancelled.requested
  • Delegated users inherit the delegator's role and permissions for the delegation period

Session Management

Sessions are tracked in Redis with the following data:

  • User ID and tenant context
  • Login timestamp and last activity
  • Device information
  • IP address

Session Lifecycle

Loading diagram...
Warning

JWT secrets must be configured consistently across all services. The JWT_SECRET environment variable must match between the Identity Service and all consuming services.