authoidcsecurityconcepts

Authentication Concepts — Persona Platform

Authentication Concepts — Persona Platform

LDAP, SSO, OIDC, OAuth 2.0, SAML 2.0, and Keycloak — explained with diagrams

LDAP

LDAP — Lightweight Directory Access Protocol

LDAP is a protocol for reading and writing a hierarchical directory of entries — users, groups, and machines. It is the canonical user store for Linux systems and enterprise networks. Applications query LDAP to authenticate users and look up attributes, but LDAP itself issues no tokens and provides no web SSO.

dc=persona,dc=local USERS ou=users GROUPS ou=groups cn=alice admin cn=bob developer cn=carol viewer cn=admins cn=devs cn=viewers ATTRIBUTES uid · cn · mail · userPassword · uidNumber · homeDirectory PORTS 389 · 636 (TLS)

Use Cases

  • Central user store for Linux/Unix systems
  • Legacy enterprise apps and VPN authentication
  • Source of truth federated into Keycloak
  • SSH key and sudo rule distribution

Limitations

  • No web SSO — no tokens, no browser redirects
  • Passwords travel as bind requests — requires TLS
  • No delegation or consent flows
  • Schema changes require server restart on many implementations

SSO

SSO — Single Sign-On

SSO lets a user authenticate once — to a central Identity Provider — and then access multiple applications without entering credentials again. The IdP issues a session or token after successful login; each application trusts that token rather than asking for a password. One login, one logout, one revocation point.

User browser 1. Login Identity Provider (Keycloak) 2. Token 3. Access APPLICATIONS ArgoCD Grafana MinIO Session Create Use Expire / Logout

Key Benefits

  • One credential — reduced password fatigue
  • One revocation point — disable user once, locked everywhere
  • Centralised audit log of all logins
  • MFA enforced once, applies to all apps

Common Implementations

  • Keycloak (open source, self-hosted)
  • Okta, Auth0 (SaaS)
  • Microsoft Entra ID (formerly Azure AD)
  • Google Workspace (consumer SSO)

OIDC

OIDC — OpenID Connect

OpenID Connect is an identity layer built on top of OAuth 2.0. Where OAuth 2.0 answers “what can this app do?”, OIDC answers “who is this user?”. It introduces the ID Token — a signed JWT that carries user identity claims. Modern applications use OIDC for both authentication and obtaining user profile information.

Browser / App Authorization Server (IdP) Resource Server 1 Auth Request + redirect_uri 2 Redirect to login page 3 User submits credentials 4 Authorization Code (short-lived) 5 Token Request (code + secret) 6 ID Token + Access Token (JWT) 7 API call with Access Token 8 Protected resource

Token Types

  • ID Token — signed JWT; proves who the user is (sub, email, name, groups)
  • Access Token — proves what the app is allowed to do; sent to APIs
  • Refresh Token — long-lived; used to get new access tokens silently

Discovery

  • Every OIDC provider exposes /.well-known/openid-configuration
  • Contains token endpoint, auth endpoint, JWKS URI
  • Keycloak: /realms/persona/.well-known/openid-configuration
  • Claims: sub, email, name, groups, roles

OAuth 2.0

OAuth 2.0 — Authorization Framework

OAuth 2.0 is an authorization framework — it answers “what is this application allowed to do?” not “who is this user?”. It defines how a client application can obtain limited access to a resource on behalf of a user, without ever seeing the user’s password. OIDC is built on top of OAuth 2.0 and adds the identity layer.

Resource Owner (the user) Client App (your application) Resource Server Authorization Server Grant Token Req Token Access (token) Authenticate Scopes (what's permitted): read:profile write:data openid email groups

Grant Types

Grant TypeWhen to UseWho Gets the Token
Authorization CodeWeb apps, mobile apps — user presentBackend server (after code exchange)
Client CredentialsMachine-to-machine (no user)The service itself
Device FlowCLI tools, TV apps, limited inputDevice polls until user approves on phone
Implicit (deprecated)Old SPAs — avoid; use Auth Code + PKCEBrowser (unsafe)

SAML 2.0

SAML 2.0 — Security Assertion Markup Language

SAML is an XML-based open standard for exchanging authentication and authorisation data between an Identity Provider and a Service Provider. Predating OIDC by a decade, it is the dominant protocol in enterprise on-premise environments (Salesforce, Workday, legacy SaaS). Keycloak supports SAML alongside OIDC.

User Browser Service Provider (SP) Identity Provider (IdP) 1 Access protected resource 2 SAML AuthnRequest (redirect) 3 Redirect — login page 4 Submit credentials 5 SAML Assertion POST (signed XML) 6 SP validates assertion — access granted

SAML vs OIDC

AspectSAML 2.0OIDC
FormatXML assertionsJSON / JWT
TransportHTTP POST / redirect (form)HTTP redirect + JSON API
Best forEnterprise on-prem, legacy SaaSAPIs, mobile, modern web apps
ComplexityHigh — XML signatures, metadata exchangeLower — JWT, discovery endpoint
Mobile supportPoor (POST binding needs browser)Excellent

Keycloak

Keycloak — Unified Identity Hub

Keycloak is an open-source Identity and Access Management server. A single Keycloak instance can serve multiple Realms (isolated identity domains), each with its own users, clients (applications), roles, and groups. It speaks OIDC, OAuth 2.0, and SAML simultaneously, and federates from LDAP or Active Directory. For Persona, one Keycloak login unlocks every internal tool.

Keycloak persona realm OIDC · OAuth2 · SAML OpenLDAP User Store LDAP Federation ArgoCD Grafana Temporal MinIO Qdrant Persona App OIDC OIDC OIDC OIDC OIDC OIDC Realm hierarchy: Realm: persona Clients (apps) Roles / Groups Users (or LDAP)

Persona Setup Plan

  • Create persona realm (isolated from other projects)
  • Add OpenLDAP federation (user source of truth)
  • Register OIDC clients: ArgoCD, Grafana, Temporal, MinIO
  • Wire Traefik ForwardAuth for apps without native OIDC (Qdrant)
  • Groups: admins, developers, viewers

Key Concepts

  • Realm — isolated domain; own users, clients, settings
  • Client — an application registered to use Keycloak OIDC
  • Client Secret — shared secret for backend code exchange
  • Role — permission unit; assigned to users or groups
  • Federation — Keycloak reads users from external LDAP

Enjoyed this post?

Get the next one in your inbox — only when I ship something worth reading.

Newsletter form not configured.

Or follow on Substack for the newsletter.

Comments via GitHub Discussions

Comments not configured. Set GISCUS env vars to enable.