Complete 3-layer API flow for seller authentication, session management, and password operations
Gateway-Level Token Validation
JWT token validation is performed at the Seller API Gateway level using Keycloak/JWT library. Tokens are validated before requests are forwarded to the Orchestra layer. Session data is cached in Redis with 1-hour TTL.
Future Architecture Note
Currently, all authentication and registration logic resides in the Seller Admin orchestration layer. In future releases, this will be migrated to a dedicated Seller Onboarding & Setup Microservice (Orchestra Layer) for better separation of concerns.
Authenticate seller with multiple methods (email/phone/OTP/social)
POST /merchant/api/v1/auth
POST /merchant/api/v1/auth
Login Flow:
Auth Modes: EMAIL_PASSWORD, MOBILE_PASSWORD, EMAIL_OTP, MOBILE_OTP, SOCIAL
POST /auth
User Service · Core Microservices
Validate token and retrieve current user details with domains/permissions
GET /merchant/api/v1/auth
GET /merchant/api/v1/auth
Verification Flow:
Note: JWT token validation happens at Gateway level (not via internal API call)
GET /auth
User Service · Core Microservices
Terminate user session and invalidate token
DELETE /merchant/api/v1/auth
DELETE /merchant/api/v1/auth
DELETE /auth
User Service · Core Microservices
Reset password using OTP verification
POST /merchant/api/v1/forgot_password
POST /merchant/api/v1/forgot_password
Validates passcode before password reset
POST /forgot_password
User Service · Core Microservices
Generate OTP for phone/email verification
POST /merchant/api/v1/passcode
POST /merchant/api/v1/passcode
Publishes Kafka event: SEND_OTP for SMS/Email delivery
POST /passcode
User Service · Core Microservices
Validate OTP for verification flows
POST /merchant/api/v1/passcode/validate
POST /merchant/api/v1/passcode/validate
POST /passcode/validate
User Service · Core Microservices
Update user profile information
PUT /merchant/api/v1/profile
PUT /merchant/api/v1/profile
Validates passcode for email/phone updates, clears Redis cache
PUT /profile
User Service · Core Microservices
Change password (requires current password)
PUT /merchant/api/v1/security
PUT /merchant/api/v1/security
PUT /security
User Service · Core Microservices
Get all active sessions with device information
GET /merchant/api/v1/domains/:domain_id/sessions
GET /merchant/api/v1/domains/:domain_id/sessions
Returns device info, IP, last activity timestamp
GET /sessions
User Service · Core Microservices
Terminate a specific session by ID
DELETE /merchant/api/v1/domains/:domain_id/sessions/:session_id
DELETE /merchant/api/v1/domains/:domain_id/sessions/:session_id
DELETE /sessions/:session_id
User Service · Core Microservices
JWT-based authentication via Keycloak, multi-factor authentication support (OTP), session tracking with device information, and secure password management.