Class OidcUserProvider

java.lang.Object
io.fluxzero.idp.bff.OidcUserProvider
All Implemented Interfaces:
io.fluxzero.sdk.tracking.handling.authentication.RefreshingUserProvider<io.fluxzero.sdk.tracking.handling.authentication.User>, io.fluxzero.sdk.tracking.handling.authentication.UserProvider

public final class OidcUserProvider extends Object implements io.fluxzero.sdk.tracking.handling.authentication.RefreshingUserProvider<io.fluxzero.sdk.tracking.handling.authentication.User>
Resolves browser requests through the registered OidcIntegration. The application maps the verified identity claims to its own User (for example Sender), including current status and roles. Internal messages, user-ID lookup and system identity retain the supplied provider's behavior. Register this wrapper as the application's UserProvider before building Fluxzero; construction does not require a Fluxzero instance, Spring, issuer discovery or key access.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Claims from the validated ID token in the encrypted session; never implied application roles.
  • Field Summary

    Fields inherited from interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider

    defaultUserProvider
  • Constructor Summary

    Constructors
    Constructor
    Description
    OidcUserProvider(io.fluxzero.sdk.tracking.handling.authentication.UserProvider delegate, BiFunction<OidcUserProvider.Identity, io.fluxzero.sdk.web.WebRequest, ? extends io.fluxzero.sdk.tracking.handling.authentication.User> mapper)
    Also supplies the request for application policies such as explicitly authorized impersonation.
    OidcUserProvider(io.fluxzero.sdk.tracking.handling.authentication.UserProvider delegate, Function<OidcUserProvider.Identity, ? extends io.fluxzero.sdk.tracking.handling.authentication.User> mapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.fluxzero.common.api.Metadata
    addToMetadata(io.fluxzero.common.api.Metadata metadata, io.fluxzero.sdk.tracking.handling.authentication.User user, boolean ifAbsent)
     
    boolean
    containsUser(io.fluxzero.common.api.Metadata metadata)
     
    io.fluxzero.sdk.tracking.handling.authentication.User
    fromMessage(io.fluxzero.sdk.common.HasMessage message)
     
    static io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    Uses the application's service-loaded mapper and existing service-loaded providers.
    static io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    fromServiceLoader(io.fluxzero.sdk.tracking.handling.authentication.UserProvider existing)
    Adds the service-loaded mapper to an existing provider.
    io.fluxzero.sdk.tracking.handling.authentication.User
     
    io.fluxzero.sdk.tracking.handling.authentication.User
     
    io.fluxzero.sdk.tracking.handling.authentication.User
     
    io.fluxzero.sdk.tracking.handling.authentication.User
    refreshUser(io.fluxzero.sdk.tracking.handling.authentication.User user, io.fluxzero.sdk.common.HasMessage message)
     
    io.fluxzero.common.api.Metadata
    removeFromMetadata(io.fluxzero.common.api.Metadata metadata)
     
    boolean
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider

    addToMetadata, andThen
  • Constructor Details

    • OidcUserProvider

      public OidcUserProvider(io.fluxzero.sdk.tracking.handling.authentication.UserProvider delegate, Function<OidcUserProvider.Identity, ? extends io.fluxzero.sdk.tracking.handling.authentication.User> mapper)
    • OidcUserProvider

      public OidcUserProvider(io.fluxzero.sdk.tracking.handling.authentication.UserProvider delegate, BiFunction<OidcUserProvider.Identity, io.fluxzero.sdk.web.WebRequest, ? extends io.fluxzero.sdk.tracking.handling.authentication.User> mapper)
      Also supplies the request for application policies such as explicitly authorized impersonation.
  • Method Details

    • fromServiceLoader

      public static io.fluxzero.sdk.tracking.handling.authentication.UserProvider fromServiceLoader()
      Uses the application's service-loaded mapper and existing service-loaded providers.
    • fromServiceLoader

      public static io.fluxzero.sdk.tracking.handling.authentication.UserProvider fromServiceLoader(io.fluxzero.sdk.tracking.handling.authentication.UserProvider existing)
      Adds the service-loaded mapper to an existing provider. With no mapper, the provider is returned unchanged. Explicit Authorization headers keep using the existing provider; cookie requests never fall back to it. The application's fluxzero.auth.oidc.disabled property restores the existing provider for all requests. Discovery is scoped to this call's context class loader, without a process-wide mapper cache.
    • fromMessage

      public io.fluxzero.sdk.tracking.handling.authentication.User fromMessage(io.fluxzero.sdk.common.HasMessage message)
      Specified by:
      fromMessage in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • getActiveUser

      public io.fluxzero.sdk.tracking.handling.authentication.User getActiveUser()
      Specified by:
      getActiveUser in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • requiresMessageBasedLocalResolution

      public boolean requiresMessageBasedLocalResolution()
      Specified by:
      requiresMessageBasedLocalResolution in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • getUserById

      public io.fluxzero.sdk.tracking.handling.authentication.User getUserById(Object userId)
      Specified by:
      getUserById in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • getSystemUser

      public io.fluxzero.sdk.tracking.handling.authentication.User getSystemUser()
      Specified by:
      getSystemUser in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • containsUser

      public boolean containsUser(io.fluxzero.common.api.Metadata metadata)
      Specified by:
      containsUser in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • removeFromMetadata

      public io.fluxzero.common.api.Metadata removeFromMetadata(io.fluxzero.common.api.Metadata metadata)
      Specified by:
      removeFromMetadata in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • addToMetadata

      public io.fluxzero.common.api.Metadata addToMetadata(io.fluxzero.common.api.Metadata metadata, io.fluxzero.sdk.tracking.handling.authentication.User user, boolean ifAbsent)
      Specified by:
      addToMetadata in interface io.fluxzero.sdk.tracking.handling.authentication.UserProvider
    • refreshUser

      public io.fluxzero.sdk.tracking.handling.authentication.User refreshUser(io.fluxzero.sdk.tracking.handling.authentication.User user, io.fluxzero.sdk.common.HasMessage message)
      Specified by:
      refreshUser in interface io.fluxzero.sdk.tracking.handling.authentication.RefreshingUserProvider<io.fluxzero.sdk.tracking.handling.authentication.User>