Epic: Identity & Access Management #2

Open
opened 2026-03-29 23:16:35 +02:00 by claude · 1 comment
Owner

Overview

Single identity plane for the entire SaaS platform. Logto handles all user-facing identity; custom Ed25519 JWT retained for machine-to-machine auth.

Architecture decision (2026-04-04): Custom auth replaced by Logto (MPL-2.0, lightest OSS IdP). Eliminates ~3-4 months of custom build: OIDC, SSO, teams, invites, MFA, password reset, custom roles. See docs/superpowers/specs/2026-04-04-dual-deployment-architecture.md.

Identity Provider: Logto

  • License: MPL-2.0 (commercially safe)
  • Footprint: 2 containers, ~0.5-1 GB RAM
  • Features in OSS: Organizations, RBAC, M2M tokens, OIDC/SSO federation, MFA
  • Docker + K8s: Works in both environments

Auth Model

Auth Type Handled By Token Format
User login/registration Logto (OIDC) RS256 JWT (Logto-issued)
SSO/OIDC federation Logto RS256 JWT
Team/org management Logto organizations
Agent bootstrap cameleer-saas Ed25519 JWT (custom)
License tokens cameleer-saas Ed25519 JWT (custom)

Logto Organizations = Tenants

  • 1:1 mapping between Logto organizations and Cameleer tenants
  • Organization tokens include organization_id claim automatically
  • User-tenant membership managed in Logto
  • Logto Management API used for programmatic org provisioning

Tier Differentiation

Feature Low Mid High Business
Platform login Yes Yes Yes Yes
OIDC/SSO federation No No Yes Yes
Custom roles No No Yes Yes
Team management Basic Basic Full Full

Key Decisions

  • Spring Security custom auth → Logto OIDC + Spring Security OAuth2 Resource Server
  • Ed25519 JWT signing retained for machine tokens (aligns with cameleer3-server pattern)
  • cameleer3-server validates SaaS-issued tokens in managed mode
  • Standalone mode retains local auth for air-gapped deployments

Eliminated Custom Build Work

  • OIDC provider implementation
  • SSO/SAML federation
  • Team/org management UI
  • Invite flow (email invites, accept/decline)
  • Password reset flow
  • MFA/2FA
  • Custom role management UI
  • Session management
## Overview Single identity plane for the entire SaaS platform. **Logto** handles all user-facing identity; custom Ed25519 JWT retained for machine-to-machine auth. > **Architecture decision (2026-04-04):** Custom auth replaced by Logto (MPL-2.0, lightest OSS IdP). Eliminates ~3-4 months of custom build: OIDC, SSO, teams, invites, MFA, password reset, custom roles. See `docs/superpowers/specs/2026-04-04-dual-deployment-architecture.md`. ## Identity Provider: Logto - **License:** MPL-2.0 (commercially safe) - **Footprint:** 2 containers, ~0.5-1 GB RAM - **Features in OSS:** Organizations, RBAC, M2M tokens, OIDC/SSO federation, MFA - **Docker + K8s:** Works in both environments ## Auth Model | Auth Type | Handled By | Token Format | |-----------|-----------|-------------| | User login/registration | Logto (OIDC) | RS256 JWT (Logto-issued) | | SSO/OIDC federation | Logto | RS256 JWT | | Team/org management | Logto organizations | — | | Agent bootstrap | cameleer-saas | Ed25519 JWT (custom) | | License tokens | cameleer-saas | Ed25519 JWT (custom) | ## Logto Organizations = Tenants - 1:1 mapping between Logto organizations and Cameleer tenants - Organization tokens include `organization_id` claim automatically - User-tenant membership managed in Logto - Logto Management API used for programmatic org provisioning ## Tier Differentiation | Feature | Low | Mid | High | Business | |---------|-----|-----|------|----------| | Platform login | Yes | Yes | Yes | Yes | | OIDC/SSO federation | No | No | Yes | Yes | | Custom roles | No | No | Yes | Yes | | Team management | Basic | Basic | Full | Full | ## Key Decisions - ~~Spring Security custom auth~~ → Logto OIDC + Spring Security OAuth2 Resource Server - Ed25519 JWT signing retained for machine tokens (aligns with cameleer3-server pattern) - cameleer3-server validates SaaS-issued tokens in managed mode - Standalone mode retains local auth for air-gapped deployments ## Eliminated Custom Build Work - ~~OIDC provider implementation~~ - ~~SSO/SAML federation~~ - ~~Team/org management UI~~ - ~~Invite flow (email invites, accept/decline)~~ - ~~Password reset flow~~ - ~~MFA/2FA~~ - ~~Custom role management UI~~ - ~~Session management~~
claude added the authepic labels 2026-03-29 23:17:57 +02:00
Author
Owner

Status Update (2026-04-07)

Logto OIDC integration is complete. The hand-rolled JWT auth (Ed25519, local users/roles/permissions) has been fully replaced with Logto as the identity provider.

What's done:

  • @logto/react SDK with org-scoped token fetching
  • Custom sign-in UI (ui/sign-in/) replacing Logto's default experience
  • 13 OAuth2 scopes on API resource (10 platform + 3 server)
  • Scope-based RBAC via @PreAuthorize("SCOPE_...") + TenantIsolationInterceptor
  • Organization roles: admin (full scopes) and member (deploy + observe)
  • platform-admin global role for SaaS owner
  • Custom JWT claim injection (org roles → roles claim for server OIDC)
  • Server SSO via Traditional Web App + OIDC auto-signup
  • Bootstrap automation: users, apps, roles, organizations, scopes, branding
  • Username display from ID token claims in sidebar + TopBar

Remaining:

  • Cross-app logout (platform logout doesn't invalidate server session — architectural, parked)
  • Team/user management UI (invite users to org, assign roles)
  • Self-service signup flow
## Status Update (2026-04-07) **Logto OIDC integration is complete.** The hand-rolled JWT auth (Ed25519, local users/roles/permissions) has been fully replaced with Logto as the identity provider. ### What's done: - `@logto/react` SDK with org-scoped token fetching - Custom sign-in UI (`ui/sign-in/`) replacing Logto's default experience - 13 OAuth2 scopes on API resource (10 platform + 3 server) - Scope-based RBAC via `@PreAuthorize("SCOPE_...")` + `TenantIsolationInterceptor` - Organization roles: `admin` (full scopes) and `member` (deploy + observe) - `platform-admin` global role for SaaS owner - Custom JWT claim injection (org roles → `roles` claim for server OIDC) - Server SSO via Traditional Web App + OIDC auto-signup - Bootstrap automation: users, apps, roles, organizations, scopes, branding - Username display from ID token claims in sidebar + TopBar ### Remaining: - Cross-app logout (platform logout doesn't invalidate server session — architectural, parked) - Team/user management UI (invite users to org, assign roles) - Self-service signup flow
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cameleer/cameleer-saas#2