- All Implemented Interfaces:
- org.springframework.security.authentication.AuthenticationProvider
@Service(value="customAuthenticationProvider")
public class CustomAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
Implements method from AuthenticationProvider in order to capture and store
the password from spring-security objects. It returns an Authentication
object filled with username, password and roles assigned to the user. This
case, this method intercepts Authentication process from spring-security,
contacts to OKM using webservices calls and sets roles to the user. It also
stores OKM ws object in cache and it is also able to store somewhere
credentials for further access by means of SecurityContextHolder
http://www.baeldung.com/spring-security-authentication-provider and
http://www.baeldung.com/spring-security-login for configuration
It is also possible to extend DAOAuthenticationProvider
(http://stackoverflow.com/questions/18220556/how-to-implement-custom-authentication-in-spring-security-3#comment27182355_18224564)