public class SpringSecurityLoginCommand extends Object implements flex.messaging.security.LoginCommand, InitializingBean
LoginCommand
that uses Spring Security for Authentication and Authorization.
Should be configured as a Spring bean and given a reference to the current AuthenticationManager
. It must be
added to the MessageBrokerFactoryBean
's list of MessageBrokerConfigProcessor
s.
Will be configured automatically when using the secured
tag in the xml config namespace.
MessageBrokerFactoryBean
Modifier and Type | Field and Description |
---|---|
protected AuthenticationDetailsSource |
authenticationDetailsSource |
Constructor and Description |
---|
SpringSecurityLoginCommand(AuthenticationManager authManager)
Creates a new SpringSecurityLoginCommand with the provided
AuthenticationManager |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Principal |
doAuthentication(String username,
Object credentials) |
boolean |
doAuthorization(Principal principal,
List roles) |
protected String |
extractPassword(Object credentials)
Extracts the password from the Flex client credentials
|
AuthenticationManager |
getAuthManager()
Returns the Spring Security
AuthenticationManager |
boolean |
isPerClientAuthentication()
Checks whether per-client authentication is enabled
|
boolean |
logout(Principal principal) |
protected void |
setDetails(javax.servlet.http.HttpServletRequest request,
UsernamePasswordAuthenticationToken authRequest)
Provided so that subclasses may configure what is put into the authentication request's details
property.
|
void |
setLogoutHandlers(List<LogoutHandler> logoutHandlers) |
void |
setPerClientAuthentication(boolean perClientAuthentication) |
void |
setRememberMeServices(RememberMeServices rememberMeServices) |
void |
setSessionAuthenticationStrategy(SessionAuthenticationStrategy sessionStrategy) |
void |
start(javax.servlet.ServletConfig config) |
void |
stop() |
protected AuthenticationDetailsSource authenticationDetailsSource
public SpringSecurityLoginCommand(AuthenticationManager authManager)
AuthenticationManager
authManager
- the authentication managerpublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public Principal doAuthentication(String username, Object credentials)
doAuthentication
in interface flex.messaging.security.LoginCommand
public boolean doAuthorization(Principal principal, List roles)
doAuthorization
in interface flex.messaging.security.LoginCommand
public AuthenticationManager getAuthManager()
AuthenticationManager
public boolean isPerClientAuthentication()
public boolean logout(Principal principal)
logout
in interface flex.messaging.security.LoginCommand
public void setLogoutHandlers(List<LogoutHandler> logoutHandlers)
public void setPerClientAuthentication(boolean perClientAuthentication)
public void setRememberMeServices(RememberMeServices rememberMeServices)
public void setSessionAuthenticationStrategy(SessionAuthenticationStrategy sessionStrategy)
public void start(javax.servlet.ServletConfig config)
start
in interface flex.messaging.security.LoginCommand
public void stop()
stop
in interface flex.messaging.security.LoginCommand
protected String extractPassword(Object credentials)
credentials
- the Flex client credentialsprotected void setDetails(javax.servlet.http.HttpServletRequest request, UsernamePasswordAuthenticationToken authRequest)
request
- that an authentication request is being created forauthRequest
- the authentication request object that should have its details setCopyright © 2014. All rights reserved.