Package com.axelor.auth.events
Class AuthenticationEventRecorder
java.lang.Object
com.axelor.auth.events.AuthenticationEventRecorder
Records successful authentications as
AuthenticationEvent.
Attempts made with direct clients are not recorded, as they authenticate every request.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationEventRecorder(jakarta.inject.Provider<ClientListService> clientListService, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptiongetProviderTitle(String clientName, org.pac4j.core.profile.CommonProfile profile) Returns a human-readable name of the provider used to authenticate.voidonLoginSuccess(User user, org.pac4j.core.profile.CommonProfile profile) Records a successful authentication.
-
Field Details
-
DETAIL_CLIENT
- See Also:
-
DETAIL_IDENTIFIER
- See Also:
-
DETAIL_USER_AGENT
- See Also:
-
DETAIL_MFA_METHOD
- See Also:
-
-
Constructor Details
-
AuthenticationEventRecorder
@Inject public AuthenticationEventRecorder(jakarta.inject.Provider<ClientListService> clientListService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
onLoginSuccess
Records a successful authentication.- Parameters:
user- the authenticated userprofile- the authenticated profile, may benullif unknown
-
getProviderTitle
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 nameprofile- the authenticated profile, may benull- Returns:
- the provider name, or
nullif the client name is unknown
-