Class HvlAuthJpaAuthenticatorImpl
java.lang.Object
tr.com.havelsan.javarch.oauth.auth.starter.authenticator.HvlAuthJpaAuthenticatorImpl
- All Implemented Interfaces:
HvlAuthAuthenticator
The class which implements
HvlAuthAuthenticator
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionHvlAuthJpaAuthenticatorImpl
(HvlAuthBundleService bundleService, HvlAuthInstanceInternalEventPublisher instanceInternalEventPublisher, HvlOAuthUserManager userManager, HvlOAuthUserOperationalManager userOperationalManager, HvlOAuthSettingIntegrationProvider settingIntegrationProvider, HvlAuthLoggerProducerProvider loggerProducerProvider, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, HvlOAuthUserPasswordPolicyManager passwordPolicyManager) Instantiates a new HvlAuthJpaAuthenticatorImpl. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(@NotNull @Valid HvlAuthAuthenticationRequestModel authenticationRequestModel) Authenticate request model.forKey()
For key authentication type.protected HvlOAuthUserModel
getUserModelByUsernameAndTenant
(HvlAuthAuthenticationRequestModel authenticationRequestModel) Gets user model by username and tenant.prepareLogAttributeMap
(HvlOAuthUserModel userModel) Prepare log attribute map hash map.protected void
sendEventLog
(String eventLogType, String eventLogBundleKey, String username) Send event log.protected void
sendEventLog
(String eventLogType, String eventLogBundleKey, String username, String authenticationType) Send event log.protected void
sendLogAndOperationEvent
(String eventLogType, String eventLogBundleKey, Map<String, Object> eventLogAttributeMap, HvlOAuthOperationEventType operationEventType, String uuid, Long userDetailId, String username) Send log and operation event.
-
Field Details
-
USERNAME_FIELD
The constant USERNAME_FIELD.- See Also:
-
AUTHENTICATION_TYPE_FIELD
The constant AUTHENTICATION_TYPE_FIELD.- See Also:
-
-
Constructor Details
-
HvlAuthJpaAuthenticatorImpl
public HvlAuthJpaAuthenticatorImpl(HvlAuthBundleService bundleService, HvlAuthInstanceInternalEventPublisher instanceInternalEventPublisher, HvlOAuthUserManager userManager, HvlOAuthUserOperationalManager userOperationalManager, HvlOAuthSettingIntegrationProvider settingIntegrationProvider, HvlAuthLoggerProducerProvider loggerProducerProvider, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, HvlOAuthUserPasswordPolicyManager passwordPolicyManager) Instantiates a new HvlAuthJpaAuthenticatorImpl.- Parameters:
bundleService
- the bundle serviceinstanceInternalEventPublisher
- the instance internal event publisheruserManager
- the user manageruserOperationalManager
- the user operational managersettingIntegrationProvider
- the setting integration providerloggerProducerProvider
- the logger producer providerpasswordEncoder
- the password encoderpasswordPolicyManager
- the password policy manager
-
-
Method Details
-
forKey
For key authentication type.- Returns:
- the authentication type
-
authenticate
@Transactional(noRollbackFor=HvlAuthException.class) public HvlOAuthUserModel authenticate(@NotNull @Valid @NotNull @Valid HvlAuthAuthenticationRequestModel authenticationRequestModel) Authenticate request model.- Parameters:
authenticationRequestModel
- the authentication request model- Returns:
- the user model
-
sendEventLog
Send event log.- Parameters:
eventLogType
- the event log typeeventLogBundleKey
- the event log bundle keyusername
- the username
-
sendEventLog
protected void sendEventLog(String eventLogType, String eventLogBundleKey, String username, String authenticationType) Send event log.- Parameters:
eventLogType
- the event log typeeventLogBundleKey
- the event log bundle keyusername
- the usernameauthenticationType
- the authentication type
-
sendLogAndOperationEvent
protected void sendLogAndOperationEvent(String eventLogType, String eventLogBundleKey, Map<String, Object> eventLogAttributeMap, HvlOAuthOperationEventType operationEventType, String uuid, Long userDetailId, String username) Send log and operation event.- Parameters:
eventLogType
- the event log typeeventLogBundleKey
- the event log bundle keyeventLogAttributeMap
- the event log attribute mapoperationEventType
- the operation event typeuuid
- the uuiduserDetailId
- the user detail idusername
- the username
-
prepareLogAttributeMap
Prepare log attribute map hash map.- Parameters:
userModel
- the user model- Returns:
- the hash map
-
getUserModelByUsernameAndTenant
protected HvlOAuthUserModel getUserModelByUsernameAndTenant(HvlAuthAuthenticationRequestModel authenticationRequestModel) Gets user model by username and tenant.- Parameters:
authenticationRequestModel
- the authentication request model- Returns:
- the user model by username and tenant
-