ws-fx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Bagguley" <davebaggu...@hotmail.com>
Subject Re: Retrieving the user's alias from a signature
Date Mon, 06 Nov 2006 10:03:26 GMT
Sorry, I forgot to include the properties my client sets dynamically instead 
of hardcoding the properties in the client config file.

axisPort._setProperty(WSHandlerConstants.ACTION,
               WSHandlerConstants.ENCRYPT + " " + 
WSHandlerConstants.SIGNATURE);
         axisPort._setProperty(WSHandlerConstants.USER, username);
         axisPort._setProperty(WSHandlerConstants.MUST_UNDERSTAND, "false");
         axisPort._setProperty(WSHandlerConstants.SIG_PROP_FILE,
               "testClient/" + username + ".properties");
          axisPort._setProperty(WSHandlerConstants.ENC_KEY_ID,
          "X509KeyIdentifier");

         axisPort._setProperty(WSHandlerConstants.ENCRYPTION_USER,
               "service.exampleService3.com");
	axisPort._setProperty(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
         axisPort._setProperty(WSHandlerConstants.ENCRYPTION_PARTS,
          "{Element}{Null}in0");
	PWCallback pwCallback = new PWCallback(password);
         axisPort._setProperty(WSHandlerConstants.PW_CALLBACK_REF, 
pwCallback);


>From: "Dave Bagguley" <davebagguley@hotmail.com>
>To: wss4j-dev@ws.apache.org
>Subject: Re: Retrieving the user's alias from a signature
>Date: Mon, 06 Nov 2006 09:55:13 +0000
>
>Yes I think I've set up the security handlers properly at the service 
>because the encrypted message gets sent to the service and the service's 
>password callback sets the password and the client recieves the correct 
>message back from the service.
>
>Below is my server config:
>declare namespace wsdd="http://xml.apache.org/axis/wsdd/";
>
><deployment
>    xmlns="http://xml.apache.org/axis/wsdd/"
>    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>
><globalConfiguration>
>  <parameter name="sendXsiTypes" value="true"/>
>  <parameter name="sendMultiRefs" value="true"/>
>  <parameter name="sendXMLDeclaration" value="true"/>
>  <requestFlow>
>      <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver" 
>name="withutandsig">
>    	<parameter name="passwordCallbackClass"
>      		value="com.exampleService3.security.PWCallback2"/>
>    	<parameter name="action" value="Encrypt Signature"/>
>    	<parameter name="signaturePropFile" value="crypto.properties" />
>    	<parameter name="decryptionPropFile" value="crypto.properties" />
>   	  </handler>
>   </requestFlow>
></globalConfiguration>
><handler name="LocalResponder" 
>type="java:org.apache.axis.transport.local.LocalResponder"/>
><handler name="URLMapper" 
>type="java:org.apache.axis.handlers.http.URLMapper"/>
><handler name="Authenticate" 
>type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
>
>	{doc("deploy.wsdd")/wsdd:deployment/wsdd:service}
>
>  <transport name="http">
>    <requestFlow>
>      <handler type="URLMapper"/>
>      <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
>    </requestFlow>
>  </transport>
>  <transport name="local">
>    <responseFlow>
>      <handler type="LocalResponder"/>
>    </responseFlow>
>  </transport>
></deployment>
>
>My client config is:
><deployment
>	  xmlns="http://xml.apache.org/axis/wsdd/"
>    	  xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>	  <transport name="http" 
>pivot="java:org.apache.axis.transport.http.HTTPSender"/>
>    <globalConfiguration>
>          <requestFlow>
>        <handler type="java:org.apache.ws.axis.security.WSDoAllSender"   
>e="DoSecuritySender">
>         </handler>
>           </requestFlow>
>    </globalConfiguration>
></deployment>
>
>The line from the FAQ that causes the null pointer exception in my password 
>callback class is:
>Vector results = (Vector) 
>msgContext.getProperty(WSHandlerConstants.RECV_RESULTS);
>
>When I use
>msgContext.getCurrentContext().getAllPropertyNames(); the following list of 
>property names is returned, as you can see RECV_RESULTS is not in the list.
>home.dir
>wsdlServiceElement
>jws.classDir
>configPath
>transport.url
>wsdlServicePort
>transport.http.servletPathInfo
>sendXsiTypes
>sendXMLDeclaration
>attachments.implementation
>allowedMethods
>remoteaddr
>path
>wsdlPortType
>realpath
>transport.http.servletLocation
>sendMultiRefs
>className
>adminPassword
>transport.http.servlet
>typeMappingVersion
>wsdlTargetNamespace
>servletEndpointContext
>attachments.Directory
>attachments.directory
>transport.http.servletResponse
>enableNamespacePrefixOptimization
>disablePrettyXML
>javax.xml.soap.character-set-encoding
>transport.http.servletRequest
>
>
>>From: "Ruchith Fernando" <ruchith.fernando@gmail.com>
>>To: "Dave Bagguley" <davebagguley@hotmail.com>
>>CC: wss4j-dev@ws.apache.org
>>Subject: Re: Retrieving the user's alias from a signature
>>Date: Sun, 5 Nov 2006 19:44:37 +0530
>>
>>Hi,
>>
>>Have you setup the security handlers properly at the service? If the
>>inflow security handler (WSDoAllReceiver) was invoked you will be able
>>to obtain the security processing results as mentioned in the WSS4J
>>FAQ.
>>
>>Thanks,
>>Ruchith
>>
>>On 11/3/06, Dave Bagguley <davebagguley@hotmail.com> wrote:
>>>Hello,
>>>
>>>I am sending a signed and encrypted soap message to service and I am 
>>>trying
>>>to extract the alias of the user from the signature contained in the soap
>>>message.  I want to do this in the password callback class of the 
>>>service.
>>>>From using TCPMonitor I can tell that the users certificate is contained 
>>>in
>>>the soap message but I don't know how to extract the alias name or any 
>>>other
>>>information from it.
>>>
>>>I have tried using the technique mentioned in the WSS4J FAQ at
>>>http://wiki.apache.org/ws/FrontPage/WsFx/wss4jFAQ#usernme but it doesn't
>>>work as (Vector) msgContext.getProperty(WSHandlerConstants.RECV_RESULTS)
>>>returns null.
>>>
>>>Any help would be greatly appreciated
>>>
>>>_________________________________________________________________
>>>Be the first to hear what's new at MSN - sign up to our free newsletters!
>>>http://www.msn.co.uk/newsletters
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
>>>For additional commands, e-mail: wss4j-dev-help@ws.apache.org
>>>
>>>
>>
>>
>>--
>>www.ruchith.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
>>For additional commands, e-mail: wss4j-dev-help@ws.apache.org
>>
>
>_________________________________________________________________
>Windows Live™ Messenger has arrived. Click here to download it for free! 
>http://imagine-msn.com/messenger/launch80/?locale=en-gb
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
>For additional commands, e-mail: wss4j-dev-help@ws.apache.org
>

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free! 
http://imagine-msn.com/messenger/launch80/?locale=en-gb


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


Mime
View raw message