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)
      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).
    • setName

      public void setName(String name)
    • 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
    • getAuthorizationGenerators

      public List<AuthorizationGenerator> getAuthorizationGenerators()
    • 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)
    • getCredentialsExtractor

      public CredentialsExtractor getCredentialsExtractor()
    • defaultCredentialsExtractor

      protected void defaultCredentialsExtractor(CredentialsExtractor credentialsExtractor)
    • getAuthenticator

      public Authenticator getAuthenticator()
    • defaultAuthenticator

      protected void defaultAuthenticator(Authenticator authenticator)
    • getProfileCreator

      public ProfileCreator getProfileCreator()
    • defaultProfileCreator

      protected void defaultProfileCreator(ProfileCreator profileCreator)
    • setCredentialsExtractor

      public void setCredentialsExtractor(CredentialsExtractor credentialsExtractor)
    • setAuthenticator

      public void setAuthenticator(Authenticator authenticator)
    • setProfileCreator

      public void setProfileCreator(ProfileCreator profileCreator)
    • getCustomProperties

      public Map<String,Object> getCustomProperties()
    • setCustomProperties

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

      public ProfileFactory getProfileFactoryWhenNotAuthenticated()
    • setProfileFactoryWhenNotAuthenticated

      public void setProfileFactoryWhenNotAuthenticated(ProfileFactory profileFactoryWhenNotAuthenticated)
    • isMultiProfile

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

      public void setMultiProfile(boolean multiProfile)
    • getSaveProfileInSession

      public Boolean getSaveProfileInSession(WebContext context, UserProfile profile)
    • setSaveProfileInSession

      public void setSaveProfileInSession(boolean saveProfileInSession)
    • toString

      public String toString()
      Overrides:
      toString in class Object