Hi ,
If you are want to look up the user credentials in an interceptor, you
could use the below codes
public void handleMessage(Message message) throws Fault {
AuthorizationPolicy policy =
message.getContent(AuthorizationPolicy.class);
...
}
Willem.
Daniel Kulp wrote:
On Tuesday 04 September 2007, Chris Campbell wrote:
I am using basic-auth with an Interceptor to look up user
credentials. However, in my WebService implementations I need to get
the result of that lookup.
Is there a sanctioned/best way to do this in CXF? Is there some sort
of request context that I am missing?
Assuming JAX-WS, add:
@Resource
protected WebServiceContext wsContext;
to your impl. The context will get injected into your impl. From
there, you should be able to do:
MessageContext mc = wsContext.getMessageContext();
mc.get(AuthorizationPolicy.class.getName());
or:
mc.get(BindingProvider.USER_NAME);
or similar to pull stuff out.