Overview
Interface for authentication and identity services. Uses local authentication in prototype; designed for future external identity provider integration.
Contract
Consumers
- AuthenticationAndAuthorizationService
- UserInterfaceDashboard
Types
| Name | Base | Constraints / Values | Description |
|---|---|---|---|
| AuthToken | object | — | JWT or session token returned on successful authentication |
| AuthResult | object | — | Result of an authentication or authorization check |
Operations
authenticate
Verify credentials and return an auth token.
| Parameter | Type | Required | Constraints |
|---|---|---|---|
username | str | ✓ | — |
password | str | ✓ | — |
Returns: AuthToken — JWT token with expiry and roles
Errors: AuthenticationError
authorize
Check whether a token holder has a required role.
| Parameter | Type | Required | Constraints |
|---|---|---|---|
token | str | ✓ | — |
required_role | str | ✓ | — |
Returns: AuthResult — Authorization result with user_id and roles
Errors: TokenExpiredError, InvalidTokenError
revoke
Invalidate an active token (logout).
| Parameter | Type | Required | Constraints |
|---|---|---|---|
token | str | ✓ | — |
Returns: None