Spring BlazeDS Integration

org.springframework.flex.security3
Class LoginMessageInterceptor

java.lang.Object
  extended by org.springframework.flex.security3.LoginMessageInterceptor
All Implemented Interfaces:
MessageInterceptor

public class LoginMessageInterceptor
extends Object
implements MessageInterceptor

MessageInterceptor implementation that replaces the standard login success message with one that contains relevant information about the logged in user.

Author:
Jeremy Grelle
See Also:
AuthenticationResultUtils

Constructor Summary
LoginMessageInterceptor()
           
 
Method Summary
protected  Object getAuthenticationResult()
          Converts the current Authentication object into a format suitable for AMF serialization back to the calling client.
 Message postProcess(MessageProcessingContext context, Message inputMessage, Message outputMessage)
          Hook for post-processing the outgoing AMF Message
 Message preProcess(MessageProcessingContext context, Message inputMessage)
          Hook for pre-processing the incoming AMF Message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginMessageInterceptor

public LoginMessageInterceptor()
Method Detail

postProcess

public Message postProcess(MessageProcessingContext context,
                           Message inputMessage,
                           Message outputMessage)
Hook for post-processing the outgoing AMF Message

Specified by:
postProcess in interface MessageInterceptor
Parameters:
context - context for the current request
inputMessage - the incoming AMF message
outputMessage - the outgoing AMF message
Returns:
the AMF message to send in response

preProcess

public Message preProcess(MessageProcessingContext context,
                          Message inputMessage)
Hook for pre-processing the incoming AMF Message

Specified by:
preProcess in interface MessageInterceptor
Parameters:
context - context for the current request
inputMessage - the incoming AMF message
Returns:
the AMF message to process in the current request

getAuthenticationResult

protected Object getAuthenticationResult()
Converts the current Authentication object into a format suitable for AMF serialization back to the calling client.

This is an intended extension point for providing a custom conversion strategy, for example, to additionally provide information from a UserDetails object. The default implementation calls AuthenticationResultUtils.getAuthenticationResult() to convert the Authentication into a simple Map of the user's principal and granted authorities. A more ambitious implementation might map onto a custom domain object for which there is a parallel ActionScript object on the client.

To provide such a custom strategy, one would extend this class and replace the default implementation in the MessageInterceptor chain by utilizing the position attribute of the message-interceptor configuration tag.

Returns:
pertinent details of the currently authenticated user

Spring BlazeDS Integration

Copyright © 2011. All Rights Reserved.