Package io.fluxzero.idp.client


package io.fluxzero.idp.client
Shared Fluxzero IDP client helpers for Fluxzero applications.

This module intentionally owns only the protocol-shaped pieces that are reusable for every Fluxzero application: tenant configuration, discovery, PKCE authorization-code exchange and JWT validation. For BFF flows, OidcLoginStateCodec can store the short-lived PKCE login transaction in an encrypted cookie so callbacks are not bound to a single backend instance. Application-specific user mapping remains outside this module. Applications are expected to keep their own SenderProvider or equivalent user provider because mapping an OIDC subject and claims to domain roles, aggregates and permissions is part of the customer domain.

The same application code should be able to run against the production Fluxzero IDP from src/main/java and against the local stub IDP from the test classpath. Token validation is therefore selected through ServiceLoader: the default validator verifies RS256 tokens through issuer discovery and JWKS, while tests can contribute a validator that trusts the in-process local stub signing key. The security invariants are the same in both cases: issuer, audience, token use, validity window and signature must all be checked.