Class AuthenticationEventRecorder

java.lang.Object
com.axelor.auth.events.AuthenticationEventRecorder

@Singleton public class AuthenticationEventRecorder extends Object
Records successful authentications as AuthenticationEvent.

Attempts made with direct clients are not recorded, as they authenticate every request.

  • Field Details

  • Constructor Details

    • AuthenticationEventRecorder

      @Inject public AuthenticationEventRecorder(jakarta.inject.Provider<ClientListService> clientListService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • onLoginSuccess

      public void onLoginSuccess(User user, org.pac4j.core.profile.CommonProfile profile)
      Records a successful authentication.
      Parameters:
      user - the authenticated user
      profile - the authenticated profile, may be null if unknown
    • getProviderTitle

      public String getProviderTitle(String clientName, org.pac4j.core.profile.CommonProfile profile)
      Returns a human-readable name of the provider used to authenticate.

      LDAP authentication goes through the form client, so it is detected from the profile. Other providers are resolved with ClientTitles, from the client if found, from its name otherwise. An unknown client name is returned as is.

      Parameters:
      clientName - the technical client name
      profile - the authenticated profile, may be null
      Returns:
      the provider name, or null if the client name is unknown