Authentication Architecture defines how Algosure establishes caller identity. Keycloak is the official Identity Provider for authentication, SSO, realms, clients, roles, groups, token issuing, MFA, and federation.
Algosure requires enterprise-grade authentication across mobile, web, internal APIs, AIOS tool calls, and integrations. Authentication must integrate with Keycloak while preserving Identity Domain ownership of business identity and authorization decisions.
sequenceDiagram
participant User as User
participant Client as Mobile or Web App
participant Keycloak as Keycloak Identity Provider
participant API as Algosure API Boundary
participant Identity as Identity Domain
participant Domain as Owning Domain
User->>Client: Start sign-in
Client->>Keycloak: Authenticate with SSO, MFA, or federation
Keycloak-->>Client: Issue token
Client->>API: Request with token
API->>Keycloak: Validate token trust
API->>Identity: Resolve Algosure identity and access context
Identity-->>API: User, roles, permissions, membership context
API->>Domain: Continue authorized request
Algosure uses Keycloak as the official Identity Provider. Realm strategy is an authentication architecture concern, not the source of business tenant ownership.
Realm Concern
Architecture Rule
Algosure realm
The Algosure realm is the primary authentication boundary for platform users, clients, service accounts, token issuing, MFA, SSO, and federation.
Environment separation
Non-production and production authentication boundaries must be separated.
Tenant representation
Customer tenant and organization context may be represented through mapped claims, groups, or attributes, but Organization remains the source of organization facts.
Federation
Enterprise identity federation is configured through Keycloak but governed by Identity, Organization, security, and tenant policy.
Social login
Future social login may be enabled only where customer segment, risk, and policy justify it.
Public client using an approved mobile authentication flow, short-lived access tokens, refresh tokens where policy allows, and no embedded client secret.
Web app
Public or confidential client depending on final web architecture; browser-facing flows must protect tokens and prevent client-side secret exposure.
Spring Boot Modulith backend
Resource server that validates JWT access tokens and enforces authenticated API access through Spring Security.
Internal services
Confidential clients or service accounts for machine-to-machine access under least privilege and audit.
Integration gateway
Uses service identity where Algosure calls external systems and separates external provider credentials from user authentication.