Chapter 16Lesson 03175–235 min

LDAP, SAML, OIDC, External Identity, Credential Rotation, and Authentication Troubleshooting: Configuration, Design Choices, and Tradeoffs

Choose external identity patterns deliberately across centralized SSO, LDAP, local break-glass access, service credentials, group mapping, session/token lifetime, and fail-closed authorization.

SSO designService identitiesFail closedBreak glassTradeoffs

Learning objectives

  • Choose local, LDAP, SAML, or OIDC according to caller and operational constraints.
  • Design external group mappings without coupling broad enterprise groups to powerful Nexus roles.
  • Separate browser SSO from package-client/service credentials.
  • Reason about session/token lifetime, compatibility, and revocation.
  • Preserve fail-closed authorization and a controlled recovery path.

Edition reminder. LDAP is Community-compatible. Self-hosted SAML and OIDC are Pro-only; User Token Support is also Pro-only. The architecture must not make those paid capabilities mandatory for Community users.

1. Central identity versus local identity

Central identity reduces duplicate account administration and lets joiner/mover/leaver processes happen in the enterprise directory or IdP. That is valuable for humans. But Nexus still needs an intentionally protected local recovery path, and automation still needs a noninteractive credential that its package client can actually use.

Choice Benefit Cost/risk Observable state
Local users only Simple, no external dependency Duplicate lifecycle, password sprawl Local users/roles, local realm, client credentials
LDAP for humans + automation Community-compatible centralized directory; Basic-style clients can use directory identity where supported Directory availability/search/cache coupling LDAP config, active realm, external groups, role mappings
SAML browser SSO Strong human SSO experience Pro-only; browser flow does not authenticate package clients SAML metadata, IdP assertions, sessions, external mappings
OIDC browser SSO Modern claims/JWK model; Pro from 3.86 Pro-only; HTTPS/provider/client-secret/claim coupling OAuth2 config, tokens/claims, external mappings
Local break-glass + external primary Recoverability during IdP outage Must be tightly controlled and tested without becoming daily admin Protected local user, local realm, documented access procedure

2. Group mapping is an authorization dependency

External groups are convenient because directory administrators can add/remove people without editing Nexus users. But that also means a directory naming or nesting change can alter repository access. Treat the external group name as part of the Nexus security API contract.

Prefer purpose-built groups such as nexus-repo-readers, nexus-release-publishers, and nexus-repository-operators instead of mapping huge organizational groups. Never map a broad group such as “all-engineering” to nx-admin.

Additive authorization still applies. External role mapping adds roles/privileges. It does not create a deny boundary that can cancel a broader grant inherited elsewhere. The Chapter 14 matrix discipline remains necessary.

3. Browser SSO versus noninteractive clients

Use case Recommended pattern Avoid
Human Nexus UI LDAP or SAML/OIDC according to edition and IdP policy Sharing local admin credentials
Maven/npm/pip/NuGet publisher Dedicated service identity + narrowly scoped client credential Trying to replay a browser SSO cookie
Container client Supported repository auth realm + dedicated identity Assuming OIDC browser access automatically becomes Docker credential
CI administrator task Separate operator/service identity with only required admin privileges Using human SSO token or root-equivalent admin

Short-lived federated tokens can improve security when the client and Nexus integration support them, but compatibility is a real constraint. A secure architecture is one the actual client can use without downgrading into plaintext secrets or overbroad fallback accounts.

4. Token/session lifetime and revocation

Browser sessions, IdP sessions, LDAP cached authentication, Nexus User Tokens, format-specific API keys, and CI credentials are separate lifecycles. Revoking one does not necessarily revoke the others immediately.

  • LDAP: consider directory disablement plus Nexus LDAP cache behavior when testing revocation.
  • SAML: disabling the IdP user prevents future SSO, but current documentation warns that existing Nexus User Tokens remain until separately revoked.
  • OIDC: token validation depends on issuer/signature/claim configuration; provider session/logout behavior can differ from Nexus session state.
  • Local/CI credentials: rotate in the secret store and prove old credential failure with a controlled request.

5. Realm order and username collisions

Realm ordering matters when the same username exists in more than one source. The safest design avoids ambiguous duplicates for privileged accounts. Keep emergency local administrator names unique and document the expected source of every privileged identity.

Protocol Current ordering guidance to start from Reason to test
LDAP Local Authenticating Realm first; LDAP below Keeps local admin efficient and resolves same-name local accounts first.
SAML Local Authenticating Realm retained and SAML below Preserves “Sign In Without SSO” recovery when SAML is unavailable.
OIDC Current OIDC guide instructs OAuth2 above Local External OIDC identity should be attempted first; duplicate names need explicit validation.

If your current version's guide changes, use the current guide and record the chosen order in the runbook. The invariant is not one hard-coded sequence; it is deterministic authentication with a tested recovery path.

6. Fail open is never an authorization strategy

If LDAP, SAML, or OIDC fails, do not enable anonymous access, remove content selectors, broaden repository roles, or map every user to a powerful role. That converts an authentication incident into an authorization incident.

Fail closed means the broken external flow denies access while known recovery identities remain available through a separate, controlled path. Recovery access should be monitored, password-rotated, and used only under an explicit incident procedure.

7. Worked design scenario

An organization has 200 developers, 30 CI jobs, an enterprise IdP, and Community Nexus today. It plans Pro next quarter. Which architecture should it adopt now?

Requirement Decision Why
Human centralized auth now LDAP Community-compatible and centrally managed.
CI publishing Dedicated LDAP or local service identities with narrow repository roles Noninteractive and client-compatible; no dependency on browser SSO.
Future human SSO Evaluate SAML/OIDC after Pro upgrade Do not prematurely couple mandatory workflows to a paid feature.
Recovery Unique local break-glass operator retained External directory/IdP outage must not eliminate emergency administration.
Role mapping Purpose-built Nexus groups Limits privilege creep from broad enterprise group membership.
Rotation Separate bind/client/cert/runbook owners Each trust object has a different lifecycle and blast radius.

8. Availability, performance, and recovery tradeoffs

External auth latency is not repository blob I/O. LDAP response latency can affect authentication; OIDC/SAML redirects depend on browser/network/IdP latency; repository downloads after authentication still depend on cache, database, blob storage, JVM, and network layers discussed earlier.

Recovery planning must cover both sides of the trust relationship. Restoring Nexus from backup does not restore the LDAP directory or IdP. Conversely, restoring an IdP does not recreate Nexus role mappings. Capture both configuration inventories and verify the relationship after recovery.

9. Knowledge check

Why is mapping “all employees” to a publisher role risky?

Should CI use a human SAML browser session?

What does fail closed mean during an IdP outage?

Does disabling a SAML user automatically revoke an existing Nexus User Token?

Why record realm ordering in the runbook?

10. Next step

Lesson 4 applies the design to incidents. You will diagnose failures from transport inward—connection, bind/redirect, identity lookup, token/assertion validation, group mapping, Nexus authorization—and resist the common mistake of treating every 401, 403, or login loop as the same problem.

Official references and version notes

Version-sensitive statements were rechecked on 2026-08-26. The current official direct-download page lists Nexus Repository 3.95.0. Nexus 3.87+ on H2/PostgreSQL requires Java 21. The mandatory learning path is Community-compatible and models external identity with local fixtures; SAML and OIDC are optional Pro-only integrations for self-hosted Nexus.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0 Send only Ethereum/ERC-20 compatible assets to this address.