aspose file tools*
The moose likes Web Services and the fly likes Apache Axis2 Rampart signatureKeyIdentifier to use when key is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Apache Axis2 Rampart signatureKeyIdentifier to use when key is "Binary Security Token"" Watch "Apache Axis2 Rampart signatureKeyIdentifier to use when key is "Binary Security Token"" New topic
Author

Apache Axis2 Rampart signatureKeyIdentifier to use when key is "Binary Security Token"

Jr McLaughlin
Greenhorn

Joined: Apr 30, 2013
Posts: 6
Hi all,

I have to call a web service that was provided by a customer (some information below is masked for this reason). I've been provided with a java keystore that contains the private key that I need to use to generate a signature to include in the WSSecurity header of my request.

Additionally, I've been sent a working SoapUI project that implements this service with the proper security configuration. The outgoing security configuration in soapUI has the "Key Identifier Type" set to "Binary Security Token" as shown below:



My question is, how do I configure this to work with rampart? I have the following axis2.xml contents:



Notice the "DirectReference" signatureKeyIdentifier. I couldn't find an equivalent to the "Binary Security Token" identifier as shown in Soap UI.

My crypto.properties looks like this:



With the aforementioned configuration, when trying to call the web service, I'm receiving this error:



Any thoughts on what may be wrong?

Thanks in advance for any help on this one!

JR
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi,

Something has to be different from Soap UI configuration and your Axis2 configuration
General security error (The private key for the supplied alias does not exist in the keystore)


What is the alias for the private key in the keystore that you use and what is the alias in your Axis2 configuration?


Best reggards,
Jr McLaughlin
Greenhorn

Joined: Apr 30, 2013
Posts: 6
Hi there,

Here are some snippets from the jks:


...


The alias name "test" is the same name that is in my crypto.properties file for the org.apache.ws.security.crypto.merlin.keystore.alias property and the same name that shows up in the SoapUI alias field.
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Random thought,
what happens if you try to execute with a user called 'test'?
Jr McLaughlin
Greenhorn

Joined: Apr 30, 2013
Posts: 6
Carles Gasques wrote:Random thought,
what happens if you try to execute with a user called 'test'?


This is the user that I am using in my axis2.xml file.
Jr McLaughlin
Greenhorn

Joined: Apr 30, 2013
Posts: 6
I resolved this issue. I had the wrong username in my password callback handler. It wasn't able to find the password to use to access the key. D'oh.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache Axis2 Rampart signatureKeyIdentifier to use when key is "Binary Security Token"