Class OidcUserProvider
- All Implemented Interfaces:
UserProvider
UserProvider for Fluxzero-compatible OIDC providers.
The provider resolves incoming WebRequest bearer tokens by calling the configured OIDC
userinfo_endpoint. This intentionally keeps the SDK implementation dependency-free while supporting both the
real Fluxzero IDP and the local dev/test IDP, because both expose the same OIDC userinfo contract.
Typical application setup:
Fluxzero fluxzero = DefaultFluxzero.builder()
.registerUserProvider(OidcUserProvider.fromProperties())
.build();
Configuration is read from fluxzero.auth.oidc.issuer; optionally
fluxzero.auth.oidc.userinfo-endpoint can override discovery.
-
Field Summary
FieldsFields inherited from class AbstractUserProvider
DEFAULT_USER_KEYFields inherited from interface UserProvider
defaultUserProvider -
Constructor Summary
ConstructorsConstructorDescriptionOidcUserProvider(String issuer) OidcUserProvider(String issuer, String userInfoEndpoint) OidcUserProvider(String issuer, String userInfoEndpoint, Duration timeout) -
Method Summary
Modifier and TypeMethodDescriptionfromMessage(HasMessage message) Extracts aUserfrom the metadata of a message.static OidcUserProviderCreates a provider from application properties.Returns theUserrepresenting the system (non-human) identity.getUserById(Object userId) Retrieves aUserby their unique identifier.protected OidcUserresolveUser(String bearerToken) Methods inherited from class AbstractUserProvider
addToMetadata, containsUser, removeFromMetadataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface UserProvider
addToMetadata, andThen, getActiveUser, requiresMessageBasedLocalResolution
-
Field Details
-
ISSUER_PROPERTY
- See Also:
-
USERINFO_ENDPOINT_PROPERTY
- See Also:
-
DEFAULT_TIMEOUT
-
-
Constructor Details
-
OidcUserProvider
-
OidcUserProvider
-
OidcUserProvider
-
-
Method Details
-
fromProperties
Creates a provider from application properties. -
getUserById
Description copied from interface:UserProviderRetrieves aUserby their unique identifier.This method is primarily used in
TestFixture-based access control tests, such as when usingwhenCommandByUser(...), to simulate requests by a specific user.Implementations may return
nullif the user cannot be found, or alternatively return a new, unprivilegedUserinstance. The latter approach allows tests to verify authorization behavior for unknown or default users without requiring explicit user creation. -
getSystemUser
Description copied from interface:UserProviderReturns theUserrepresenting the system (non-human) identity. Typically used for scheduled messages, internal services, etc. -
fromMessage
Description copied from class:AbstractUserProviderExtracts aUserfrom the metadata of a message.Uses the configured
metadataKeyto locate the user in the metadata of the given message.- Specified by:
fromMessagein interfaceUserProvider- Overrides:
fromMessagein classAbstractUserProvider- Parameters:
message- the message containing metadata- Returns:
- the resolved
User, ornullif not found
-
resolveUser
-