You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by HamletDRC <ha...@gmail.com> on 2009/09/26 00:34:12 UTC

Can't get WebServiceContext in CallbackHandler

I have a CallbackHandler implementation handling my username/password
authentication. I'm wiring it into the CXF WSS4JInterceptor that comes with
CXF: 

<bean id="wss4jInterceptor"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
scope="prototype">
	<constructor-arg>
		<map>
			<entry key="action" value="UsernameToken"/>
			<entry key="passwordType" value="PasswordText"/>
			<entry key="passwordCallbackClass" value="MyUserPasswordCallback"/>
		</map>
	</constructor-arg>
</bean>

Is there any way to get the SOAP Message or the WebServiceContext within the
Password callback? 

-----
--
Hamlet D'Arcy

-- 
View this message in context: http://www.nabble.com/Can%27t-get-WebServiceContext-in-CallbackHandler-tp25620267p25620267.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Can't get WebServiceContext in CallbackHandler

Posted by Daniel Kulp <dk...@apache.org>.
The easiest method is probably to call:

PhaseInterceptorChain.getCurrentMessage()

to get the CXF Message object that is currently being processed.   From there, 
you should be able to get most of the other things you need.

Dan

On Fri September 25 2009 6:34:12 pm HamletDRC wrote:
> I have a CallbackHandler implementation handling my username/password
> authentication. I'm wiring it into the CXF WSS4JInterceptor that comes with
> CXF:
> 
> <bean id="wss4jInterceptor"
> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
> scope="prototype">
> 	<constructor-arg>
> 		<map>
> 			<entry key="action" value="UsernameToken"/>
> 			<entry key="passwordType" value="PasswordText"/>
> 			<entry key="passwordCallbackClass" value="MyUserPasswordCallback"/>
> 		</map>
> 	</constructor-arg>
> </bean>
> 
> Is there any way to get the SOAP Message or the WebServiceContext within
>  the Password callback?
> 
> -----
> --
> Hamlet D'Arcy
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog