You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Dave Bagguley <da...@hotmail.com> on 2006/11/03 14:26:54 UTC

Retrieving the user's alias from a signature

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


SecurityPolicy Examples (apologies for re-post)

Posted by Prateek Mishra <pr...@oracle.com>.
> We would like to draw the wss4j community's attention to a document 
> titled:
>
> SecurityPolicy Examples
>
> available at:
>
> http://lists.oasis-open.org/archives/ws-sx/200611/doc00003.doc
>
> which described several common security policy use-cases with some 
> discussion.
>
> We would be interested in obtaining feedback on this document, it can 
> be sent to the OASIS
> e-mail archives (there is a comment facility) or directly to the authors.
>
> Thanks,
> prateek mishra
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: wss4j-dev-help@ws.apache.org
>



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


SecurityPolicy Examples (apologies for re-post)

Posted by Prateek Mishra <pr...@oracle.com>.
> We would like to draw the wss4j community's attention to a document 
> titled:
>
> SecurityPolicy Examples
>
> available at:
>
> http://lists.oasis-open.org/archives/ws-sx/200611/doc00003.doc
>
> which described several common security policy use-cases with some 
> discussion.
>
> We would be interested in obtaining feedback on this document, it can 
> be sent to the OASIS
> e-mail archives (there is a comment facility) or directly to the authors.
>
> Thanks,
> prateek mishra
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: wss4j-dev-help@ws.apache.org
>



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


Re: Retrieving the user's alias from a signature

Posted by Prateek Mishra <pr...@oracle.com>.
We would like to draw the wss4j community's attention to a document titled:

SecurityPolicy Examples

available at:

http://lists.oasis-open.org/archives/ws-sx/200611/doc00003.doc

which described several common security policy use-cases with some 
discussion.

We would be interested in obtaining feedback on this document, it can be 
sent to the OASIS
e-mail archives (there is a comment facility) or directly to the authors.

Thanks,
prateek mishra


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


Re: Retrieving the user's alias from a signature

Posted by Prateek Mishra <pr...@oracle.com>.
We would like to draw the wss4j community's attention to a document titled:

SecurityPolicy Examples

available at:

http://lists.oasis-open.org/archives/ws-sx/200611/doc00003.doc

which described several common security policy use-cases with some 
discussion.

We would be interested in obtaining feedback on this document, it can be 
sent to the OASIS
e-mail archives (there is a comment facility) or directly to the authors.

Thanks,
prateek mishra


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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
Ok thanks for that.  As i really needed to access the signature holder in 
the password callback handler I found the following (albeit rather hacky) 
way of doing it if anyone is interested:

public void handle(Callback[] callbacks) throws UnsupportedCallbackException
   {

      for (int i = 0; i < callbacks.length; i++)
      {
         if (callbacks[i] instanceof WSPasswordCallback)
         {
            WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];

            String username = null;
            try
            {

               // Extract the client's public key from the soap header
               MessageContext mc = MessageContext.getCurrentContext();
               String header = mc.getCurrentMessage().getSOAPHeader()
                     .toString();
               // Search through the header to find where the key is
               header = header.substring(header
                     .indexOf("<wsse:BinarySecurityToken"), header
                     .indexOf("</wsse:BinarySecurityToken>"));
               String key = header.substring(header.indexOf('>') + 1);

               // Create a X509 certificate containing the client's data 
that was just extracted
               ByteArrayInputStream bis = new ByteArrayInputStream(
                     ("-----BEGIN CERTIFICATE-----\n" + key + "\n-----END 
CERTIFICATE-----")
                           .getBytes());
               CertificateFactory cf = 
CertificateFactory.getInstance("X.509");
               X509Certificate cert = (X509Certificate) cf
                     .generateCertificate(bis);
               username = cert.getSubjectX500Principal().getName();
               // Remove the "cn=" part
               username = username.substring(3);
               bis.close();

            } catch (Exception ex)



>From: "Ruchith Fernando" <ru...@gmail.com>
>To: "Dave Bagguley" <da...@hotmail.com>
>CC: wss4j-dev@ws.apache.org
>Subject: Re: Retrieving the user's alias from a signature
>Date: Mon, 6 Nov 2006 17:15:44 +0530
>
>Yep .. its not available at the callback handler ... the callback
>handler is called while within the security handler. And security
>results are available only after the security handler
>(WSDoAllreceiver) returns.
>
>thanks,
>Ruchith
>
>On 11/6/06, Dave Bagguley <da...@hotmail.com> wrote:
>>I can get the code from the FAQ to work when I put it in my service
>>implementation but not when I put it in the password callback class where 
>>I
>>need it.
>>
>>
>> >From: "Dave Bagguley" <da...@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" <ru...@gmail.com>
>> >>To: "Dave Bagguley" <da...@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 <da...@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
>> >
>>
>>_________________________________________________________________
>>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
>

_________________________________________________________________
The new Windows Live Toolbar helps you guard against viruses 
http://toolbar.live.com/?mkt=en-gb


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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
Ok thanks for that.  As i really needed to access the signature holder in 
the password callback handler I found the following (albeit rather hacky) 
way of doing it if anyone is interested:

public void handle(Callback[] callbacks) throws UnsupportedCallbackException
   {

      for (int i = 0; i < callbacks.length; i++)
      {
         if (callbacks[i] instanceof WSPasswordCallback)
         {
            WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];

            String username = null;
            try
            {

               // Extract the client's public key from the soap header
               MessageContext mc = MessageContext.getCurrentContext();
               String header = mc.getCurrentMessage().getSOAPHeader()
                     .toString();
               // Search through the header to find where the key is
               header = header.substring(header
                     .indexOf("<wsse:BinarySecurityToken"), header
                     .indexOf("</wsse:BinarySecurityToken>"));
               String key = header.substring(header.indexOf('>') + 1);

               // Create a X509 certificate containing the client's data 
that was just extracted
               ByteArrayInputStream bis = new ByteArrayInputStream(
                     ("-----BEGIN CERTIFICATE-----\n" + key + "\n-----END 
CERTIFICATE-----")
                           .getBytes());
               CertificateFactory cf = 
CertificateFactory.getInstance("X.509");
               X509Certificate cert = (X509Certificate) cf
                     .generateCertificate(bis);
               username = cert.getSubjectX500Principal().getName();
               // Remove the "cn=" part
               username = username.substring(3);
               bis.close();

            } catch (Exception ex)



>From: "Ruchith Fernando" <ru...@gmail.com>
>To: "Dave Bagguley" <da...@hotmail.com>
>CC: wss4j-dev@ws.apache.org
>Subject: Re: Retrieving the user's alias from a signature
>Date: Mon, 6 Nov 2006 17:15:44 +0530
>
>Yep .. its not available at the callback handler ... the callback
>handler is called while within the security handler. And security
>results are available only after the security handler
>(WSDoAllreceiver) returns.
>
>thanks,
>Ruchith
>
>On 11/6/06, Dave Bagguley <da...@hotmail.com> wrote:
>>I can get the code from the FAQ to work when I put it in my service
>>implementation but not when I put it in the password callback class where 
>>I
>>need it.
>>
>>
>> >From: "Dave Bagguley" <da...@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" <ru...@gmail.com>
>> >>To: "Dave Bagguley" <da...@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 <da...@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
>> >
>>
>>_________________________________________________________________
>>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
>

_________________________________________________________________
The new Windows Live Toolbar helps you guard against viruses 
http://toolbar.live.com/?mkt=en-gb


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


Re: Retrieving the user's alias from a signature

Posted by Ruchith Fernando <ru...@gmail.com>.
Yep .. its not available at the callback handler ... the callback
handler is called while within the security handler. And security
results are available only after the security handler
(WSDoAllreceiver) returns.

thanks,
Ruchith

On 11/6/06, Dave Bagguley <da...@hotmail.com> wrote:
> I can get the code from the FAQ to work when I put it in my service
> implementation but not when I put it in the password callback class where I
> need it.
>
>
> >From: "Dave Bagguley" <da...@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" <ru...@gmail.com>
> >>To: "Dave Bagguley" <da...@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 <da...@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
> >
>
> _________________________________________________________________
> 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


Re: Retrieving the user's alias from a signature

Posted by Ruchith Fernando <ru...@gmail.com>.
Yep .. its not available at the callback handler ... the callback
handler is called while within the security handler. And security
results are available only after the security handler
(WSDoAllreceiver) returns.

thanks,
Ruchith

On 11/6/06, Dave Bagguley <da...@hotmail.com> wrote:
> I can get the code from the FAQ to work when I put it in my service
> implementation but not when I put it in the password callback class where I
> need it.
>
>
> >From: "Dave Bagguley" <da...@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" <ru...@gmail.com>
> >>To: "Dave Bagguley" <da...@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 <da...@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
> >
>
> _________________________________________________________________
> 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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
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" <da...@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" <ru...@gmail.com>
>>To: "Dave Bagguley" <da...@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 <da...@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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
I can get the code from the FAQ to work when I put it in my service 
implementation but not when I put it in the password callback class where I 
need it.


>From: "Dave Bagguley" <da...@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" <ru...@gmail.com>
>>To: "Dave Bagguley" <da...@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 <da...@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
>

_________________________________________________________________
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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
I can get the code from the FAQ to work when I put it in my service 
implementation but not when I put it in the password callback class where I 
need it.


>From: "Dave Bagguley" <da...@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" <ru...@gmail.com>
>>To: "Dave Bagguley" <da...@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 <da...@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
>

_________________________________________________________________
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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
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" <da...@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" <ru...@gmail.com>
>>To: "Dave Bagguley" <da...@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 <da...@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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
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" <ru...@gmail.com>
>To: "Dave Bagguley" <da...@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 <da...@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


Re: Retrieving the user's alias from a signature

Posted by Dave Bagguley <da...@hotmail.com>.
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" <ru...@gmail.com>
>To: "Dave Bagguley" <da...@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 <da...@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


Re: Retrieving the user's alias from a signature

Posted by Ruchith Fernando <ru...@gmail.com>.
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 <da...@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


Re: Retrieving the user's alias from a signature

Posted by Ruchith Fernando <ru...@gmail.com>.
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 <da...@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