You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ja...@aurora.org on 2008/01/21 23:58:50 UTC

Is it possible to pass the security principle from the client request to the response?

Hello,

Has anyone used interceptors or handlers to set information in the request 
so that it comes back in the response?
If that is not possible, is there a way to tell CXF to persist attributes 
in memory so that you can keep track of information that was available in 
the request for when you intercept the response?

What I am trying to do is figure out how to keep track of the security 
principle/alias/Issuer that was used to sign the document so it can be 
used later as the "encryptionUser" going outbound.

I know you can set this with a properties file, but I need the 
"encryptionUser" to be set based off of the incoming request (ie. I will 
have many clients with different keys).


Re: Is it possible to pass the security principle from the client request to the response?

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 21 January 2008, jason.laskowski@aurora.org wrote:
> Hello,
>
> Has anyone used interceptors or handlers to set information in the
> request so that it comes back in the response?
> If that is not possible, is there a way to tell CXF to persist
> attributes in memory so that you can keep track of information that
> was available in the request for when you intercept the response?
>
> What I am trying to do is figure out how to keep track of the security
> principle/alias/Issuer that was used to sign the document so it can be
> used later as the "encryptionUser" going outbound.
>
> I know you can set this with a properties file, but I need the
> "encryptionUser" to be set based off of the incoming request (ie. I
> will have many clients with different keys).

In the incoming interceptor, you can call message.getExchange() to get 
the full exchange.   Depending on the phse, the outgoing message may 
have been created, but I wouldn't count on that.   Most likely, you 
should set the property you want to save on the exchange itself and then 
in an outgoing interceptor, grab it from there.    (Actually, the 
outgoing interceptor could call msg.getExchange() and get the incoming 
message from there if you want to grab stuff from the incoming message)


-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog