You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Thomas Grabietz <to...@toms-toy.de> on 2011/10/18 16:17:34 UTC

MessageContext.getCurrentMessageContext().getProperty(RampartMessageData.USERNAME)) is allways null

Hello All,
I've enabled rampart and the everything works so far except the
RampartMessageData.USERNAME is not stored in the MessageContext.
I'm using Axis 1.60 and rampart 1.60.

<module ref="rampart"/>
     <parameter
			name="InflowSecurity">
			<action>
				<items>UsernameToken</items>
			
<passwordCallbackClass>...MyPasswordCallbackHandler</passwordCallbackClass>
			</action>
		</parameter>

Must I configure something else?

Regards Tom

-- 
Für's private
http://toms-toy.de/Thomas%20Grabietz%20tom@toms-toy.de%20(0xE43515AC)%20pub.asc

GIT d-(---)? s():()> a+ C$>++ UL$>+ P? L>++ E W>+++ N>++$ o K--? w>--- O
M>-- V PS>+ PE Y PGP>++$ t 5 X R tv b>+++ DI D G e> h>++ !r y>+

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: MessageContext.getCurrentMessageContext().getProperty(RampartMessageData.USERNAME)) is allways null

Posted by Thomas Grabietz <to...@toms-toy.de>.
So, I found the solution for this problem by investigating the sourcecode:

There must be a ws-policy defined (like the one below), otherwise the
RampartEngine class does not store the RampartMessageData into the
MessageContext.

Reagards Tom


<wsp:Policy wsu:Id="UTOverTransport"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
			<wsp:ExactlyOne>
				<wsp:All>
					<sp:SignedSupportingTokens
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
						<wsp:Policy>
							<sp:UsernameToken
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"
/>
						</wsp:Policy>
					</sp:SignedSupportingTokens>
					<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
					
<ramp:passwordCallbackClass>MyPasswordCallbackHandler</ramp:passwordCallbackClass>
					</ramp:RampartConfig>
				</wsp:All>
			</wsp:ExactlyOne>
		</wsp:Policy>

Am 18.10.2011 16:17, schrieb Thomas Grabietz:
> Hello All,
> I've enabled rampart and the everything works so far except the
> RampartMessageData.USERNAME is not stored in the MessageContext.
> I'm using Axis 1.60 and rampart 1.60.
> 
> <module ref="rampart"/>
>      <parameter
> 			name="InflowSecurity">
> 			<action>
> 				<items>UsernameToken</items>
> 			
> <passwordCallbackClass>...MyPasswordCallbackHandler</passwordCallbackClass>
> 			</action>
> 		</parameter>
> 
> Must I configure something else?
> 
> Regards Tom
> 


-- 
Für's private
http://toms-toy.de/Thomas%20Grabietz%20tom@toms-toy.de%20(0xE43515AC)%20pub.asc

GIT d-(---)? s():()> a+ C$>++ UL$>+ P? L>++ E W>+++ N>++$ o K--? w>--- O
M>-- V PS>+ PE Y PGP>++$ t 5 X R tv b>+++ DI D G e> h>++ !r y>+

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org