org.springframework.flex.messaging.security
Class SpringSecurityLoginCommand

java.lang.Object
  extended by org.springframework.flex.messaging.security.SpringSecurityLoginCommand
All Implemented Interfaces:
flex.messaging.security.LoginCommand, MessageBrokerConfigProcessor

public class SpringSecurityLoginCommand
extends java.lang.Object
implements flex.messaging.security.LoginCommand, MessageBrokerConfigProcessor

Custom BlazeDS 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 MessageBrokerConfigProcessors.

Will be configured automatically when using the secured tag in the xml config namespace.

Author:
Jeremy Grelle
See Also:
MessageBrokerFactoryBean

Constructor Summary
SpringSecurityLoginCommand(org.springframework.security.AuthenticationManager authManager)
           
 
Method Summary
 java.security.Principal doAuthentication(java.lang.String username, java.lang.Object credentials)
           
 boolean doAuthorization(java.security.Principal principal, java.util.List roles)
           
protected  java.lang.String extractPassword(java.lang.Object credentials)
           
 org.springframework.security.AuthenticationManager getAuthManager()
           
 boolean isInvalidateFlexSession()
           
 boolean isPerClientAuthentication()
           
 boolean logout(java.security.Principal principal)
           
 flex.messaging.MessageBroker processAfterStartup(flex.messaging.MessageBroker broker)
          Apply this config processor to the newly created MessageBroker after it and all of its services have been started but before it is available for use.
 flex.messaging.MessageBroker processBeforeStartup(flex.messaging.MessageBroker broker)
          Apply this config processor to the newly created MessageBroker after its intial configuration settings have been parsed from the BlazeDS XML configuration, but before it has actually been started.
 void setInvalidateFlexSession(boolean invalidateFlexSession)
           
 void setPerClientAuthentication(boolean perClientAuthentication)
           
 void start(javax.servlet.ServletConfig config)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringSecurityLoginCommand

public SpringSecurityLoginCommand(org.springframework.security.AuthenticationManager authManager)
Method Detail

setInvalidateFlexSession

public void setInvalidateFlexSession(boolean invalidateFlexSession)

setPerClientAuthentication

public void setPerClientAuthentication(boolean perClientAuthentication)

getAuthManager

public org.springframework.security.AuthenticationManager getAuthManager()

isInvalidateFlexSession

public boolean isInvalidateFlexSession()

isPerClientAuthentication

public boolean isPerClientAuthentication()

doAuthentication

public java.security.Principal doAuthentication(java.lang.String username,
                                                java.lang.Object credentials)
Specified by:
doAuthentication in interface flex.messaging.security.LoginCommand

doAuthorization

public boolean doAuthorization(java.security.Principal principal,
                               java.util.List roles)
Specified by:
doAuthorization in interface flex.messaging.security.LoginCommand

logout

public boolean logout(java.security.Principal principal)
Specified by:
logout in interface flex.messaging.security.LoginCommand

start

public void start(javax.servlet.ServletConfig config)
Specified by:
start in interface flex.messaging.security.LoginCommand

stop

public void stop()
Specified by:
stop in interface flex.messaging.security.LoginCommand

processAfterStartup

public flex.messaging.MessageBroker processAfterStartup(flex.messaging.MessageBroker broker)
Description copied from interface: MessageBrokerConfigProcessor
Apply this config processor to the newly created MessageBroker after it and all of its services have been started but before it is available for use.

Specified by:
processAfterStartup in interface MessageBrokerConfigProcessor
Parameters:
broker - the started MessageBroker instance
Returns:
the modified MessageBroker

processBeforeStartup

public flex.messaging.MessageBroker processBeforeStartup(flex.messaging.MessageBroker broker)
Description copied from interface: MessageBrokerConfigProcessor
Apply this config processor to the newly created MessageBroker after its intial configuration settings have been parsed from the BlazeDS XML configuration, but before it has actually been started.

Specified by:
processBeforeStartup in interface MessageBrokerConfigProcessor
Parameters:
broker - the new MessageBroker instance
Returns:
the modified MessageBroker

extractPassword

protected java.lang.String extractPassword(java.lang.Object credentials)