Package africa.absa.inception.security
Class SecurityServiceAuthenticationManager
java.lang.Object
africa.absa.inception.security.SecurityServiceAuthenticationManager
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationManager
public class SecurityServiceAuthenticationManager
extends Object
implements org.springframework.security.authentication.AuthenticationManager
The SecurityServiceAuthenticationManager class provides an authentication manager
implementation based on the Security Service.
- Author:
- Marcus Portmann
-
Constructor Summary
ConstructorsConstructorDescriptionSecurityServiceAuthenticationManager(ISecurityService securityService, UserDetailsService userDetailsService) Constructs a new SecurityServiceAuthenticationManager. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) Attempts to authenticate the passedAuthenticationobject, returning a fully populated Authentication object (including granted authorities) if successful.
-
Constructor Details
-
SecurityServiceAuthenticationManager
public SecurityServiceAuthenticationManager(ISecurityService securityService, UserDetailsService userDetailsService) Constructs a new SecurityServiceAuthenticationManager.- Parameters:
securityService- the Security ServiceuserDetailsService- the User Details Service
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException Attempts to authenticate the passedAuthenticationobject, returning a fully populated Authentication object (including granted authorities) if successful.An AuthenticationManager must honour the following contract concerning exceptions:
- A
DisabledExceptionmust be thrown if an account is disabled and the AuthenticationManager can test for this state. - A
LockedExceptionmust be thrown if an account is locked and the AuthenticationManager can test for account locking. - A
BadCredentialsExceptionmust be thrown if incorrect credentials are presented. Whilst the above exceptions are optional, an AuthenticationManager must always test credentials.
Exceptions should be tested for and if applicable thrown in the order expressed above (i.e. if an account is disabled or locked, the authentication request is immediately rejected and the credentials testing process is not performed). This prevents credentials being tested against disabled or locked accounts.
- Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationManager- Parameters:
authentication- the authentication request object- Returns:
- a fully authenticated object including credentials
- Throws:
org.springframework.security.core.AuthenticationException
- A
-