Package com.openkm.auth
Class CustomAuthenticationProvider
- java.lang.Object
-
- com.openkm.auth.CustomAuthenticationProvider
-
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
@Service("customAuthenticationProvider") public class CustomAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProviderImplements 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)
-
-
Constructor Summary
Constructors Constructor Description CustomAuthenticationProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication)booleansupports(Class<?> authentication)
-
-
-
Method Detail
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException- Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
supports
public boolean supports(Class<?> authentication)
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-
-