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.AuthenticationResultUtils
Constructor and Description |
---|
LoginMessageInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected Object |
getAuthenticationResult()
Converts the current
Authentication object into a format suitable for AMF serialization back to the calling client. |
flex.messaging.messages.Message |
postProcess(MessageProcessingContext context,
flex.messaging.messages.Message inputMessage,
flex.messaging.messages.Message outputMessage)
Hook for post-processing the outgoing AMF
Message |
flex.messaging.messages.Message |
preProcess(MessageProcessingContext context,
flex.messaging.messages.Message inputMessage)
Hook for pre-processing the incoming AMF
Message |
public flex.messaging.messages.Message postProcess(MessageProcessingContext context, flex.messaging.messages.Message inputMessage, flex.messaging.messages.Message outputMessage)
Message
postProcess
in interface MessageInterceptor
context
- context for the current requestinputMessage
- the incoming AMF messageoutputMessage
- the outgoing AMF messagepublic flex.messaging.messages.Message preProcess(MessageProcessingContext context, flex.messaging.messages.Message inputMessage)
Message
preProcess
in interface MessageInterceptor
context
- context for the current requestinputMessage
- the incoming AMF messageprotected Object getAuthenticationResult()
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.
Copyright © 2014. All rights reserved.