Class BaseClient

All Implemented Interfaces:
Client
Direct Known Subclasses:
DirectClient, IndirectClient

public abstract class BaseClient extends InitializableObject implements Client

This class is the default implementation of an authentication client (whatever the mechanism). It has the core concepts:

Since:
1.4.0
Author:
Jerome Leleu
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
    • saveProfileInSession

      protected Boolean saveProfileInSession
  • Constructor Details

    • BaseClient

      public BaseClient()
  • Method Details

    • retrieveCredentials

      protected Optional<Credentials> retrieveCredentials(WebContext context, SessionStore sessionStore, ProfileManagerFactory profileManagerFactory)
      Retrieve the credentials.
      Parameters:
      context - the web context
      Returns:
      the credentials
    • getUserProfile

      public final Optional<UserProfile> getUserProfile(Credentials credentials, WebContext context, SessionStore sessionStore)
      Description copied from interface: Client
      Get the user profile based on the provided credentials.
      Specified by:
      getUserProfile in interface Client
      Parameters:
      credentials - credentials
      context - web context
      sessionStore - the session store
      Returns:
      the user profile (optional)
    • retrieveUserProfile

      protected final Optional<UserProfile> retrieveUserProfile(Credentials credentials, WebContext context, SessionStore sessionStore)
      Retrieve a user profile.
      Parameters:
      credentials - the credentials
      context - the web context
      Returns:
      the user profile
    • renewUserProfile

      public Optional<UserProfile> renewUserProfile(UserProfile profile, WebContext context, SessionStore sessionStore)
      Description copied from interface: Client
      Renew the user profile.
      Specified by:
      renewUserProfile in interface Client
      Parameters:
      profile - the user profile
      context - the current web context
      sessionStore - the session store
      Returns:
      the renewed user profile (optional).
    • getName

      public String getName()
      Description copied from interface: Client
      Get the name of the client.
      Specified by:
      getName in interface Client
      Returns:
      the name of the client
    • notifySessionRenewal

      public void notifySessionRenewal(String oldSessionId, WebContext context, SessionStore sessionStore)
      Notify of the web session renewal.
      Parameters:
      oldSessionId - the old session identifier
      context - the web context
      sessionStore - the session store
    • setAuthorizationGenerators

      public void setAuthorizationGenerators(List<AuthorizationGenerator> authorizationGenerators)
    • setAuthorizationGenerators

      public void setAuthorizationGenerators(AuthorizationGenerator... authorizationGenerators)
    • setAuthorizationGenerator

      public void setAuthorizationGenerator(AuthorizationGenerator authorizationGenerator)
      Add an authorization generator.
      Parameters:
      authorizationGenerator - an authorizations generator
    • addAuthorizationGenerator

      public void addAuthorizationGenerator(AuthorizationGenerator authorizationGenerator)
    • addAuthorizationGenerators

      public void addAuthorizationGenerators(List<AuthorizationGenerator> authorizationGenerators)
    • defaultCredentialsExtractor

      protected void defaultCredentialsExtractor(CredentialsExtractor credentialsExtractor)
    • defaultAuthenticator

      protected void defaultAuthenticator(Authenticator authenticator)
    • defaultProfileCreator

      protected void defaultProfileCreator(ProfileCreator profileCreator)
    • setCustomProperties

      public void setCustomProperties(Map<String,Object> customProperties)
    • setProfileFactoryWhenNotAuthenticated

      public void setProfileFactoryWhenNotAuthenticated(ProfileFactory profileFactoryWhenNotAuthenticated)
    • isMultiProfile

      public boolean isMultiProfile(WebContext context, UserProfile profile)
    • getSaveProfileInSession

      public Boolean getSaveProfileInSession(WebContext context, UserProfile profile)