| Author |
.NET WSE and Java Client
|
|
| Matthias 2006-05-24, 4:14 am |
| Hi guys,
I have a .NET web service which wants a UsernameToken, signature and
encryption.
Now I want to access the web service with a Java client (WSS4J). I was
able to configure the deployment descriptor to send a UsernameToken.
But how do I have to configure the signature and the encryption? I
think so:
<handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="Signature UsernameToken Encrypt"/>
<parameter name="user" value="Username"/>
<parameter name="passwordCallbackClass" value="PWCallback"/>
<parameter name="passwordType" value="PasswordText" />
<parameter name="addUTElement" value="Nonce Created" />
<parameter name="signaturePropFile" value="security.properties" />
</handler>
But how do I get the security.properties? What must be in it?
MH
| |
|
|
| Matthias 2006-05-26, 8:06 am |
| These examples always generate a private and a public key.
In my case the UsernameToken will be used to encrypt and sign the
message. if the server knows the password for the user, then the server
can decrypt the message.
How can I add a signature with the UsernameToken as key? The class
WSSecSignature needs a crypto-object. I don't have one...
| |
| Matthias 2006-05-29, 4:17 am |
| I found the following:
<parameter name="action" value="UsernameTokenSignature" />
this signs the message with the UsernameToken.
Now I need the encryption with the UsernameToken. Does anyone know how
I could do this?
| |
| wheresjim 2006-05-31, 7:12 pm |
|
Matthias wrote:
> I found the following:
>
> <parameter name="action" value="UsernameTokenSignature" />
>
> this signs the message with the UsernameToken.
> Now I need the encryption with the UsernameToken. Does anyone know how
> I could do this?
I've been working on this exact problem too, what you want to use is
"UsernameTokenSignature" in place of "Signature UsernameToken". You
may find that you also need to add other elements into the signature
such as an Action header, ReplyTo, etc. Also apparently Timestamp is
also an important part of this.
Here is a copy of my current .wsdd file. My current problem is that
the password sent in the username token is of type Text instead of
digest, despite me setting the password to be digest in the .wsdd file:
<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 >
<parameter name="addressing.sendReplyTo" value="true"/>
<parameter name="enableNamespacePrefixOptimization" value="false"/>
<requestFlow >
<!-- ADDRESSING -->
<handler
type="java:org.apache.axis.message.addressing.handler.AddressingHandler">
<parameter name="referencePropertyNames"
value="{Element}{http://schemas.xmlsoap.org/ws/2004/08/addressing}MessageID;{Element}{http://schemas.xmlsoap.org/ws/2004/08/addressing}Action;{Element}{http://schemas.xmlsoap.org/ws/2004/08/addressing}To;{Element}{http://schemas.xmlsoap.org/ws/2004/08/add
ressing}ReplyTo"/>
</handler>
<!-- SECURITY -->
<handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="Timestamp UsernameTokenSignature"/>
<parameter name="passwordType" value="PasswordDigest"/>
<!--<parameter name="user" value="test"/> setting username in stub
class now -->
<parameter name="passwordCallbackClass"
value="com.somepackage.security.PWCallback"/>
<parameter name="precisionInMilliseconds" value="false" />
<parameter name="signatureParts"
value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body;{Element}{http://schemas.xmlsoap.org/ws/2004/08/addressing}MessageID;{Element}{http://schemas.xmlsoap.org/ws/2004/08/addressing}Action;{Element}{http://schemas.xmlsoap.org/ws/2004/08/addressi
ng}To;{Element}{http://schemas.xmlsoap.org/ws/2004/08/addressing}ReplyTo"/>
</handler>
</requestFlow >
</globalConfiguration >
</deployment>
|
|
|
|