aspose file tools*
The moose likes Web Services and the fly likes please answer - client authentication with certificate in Axis 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "please answer - client authentication with certificate in Axis 1" Watch "please answer - client authentication with certificate in Axis 1" New topic
Author

please answer - client authentication with certificate in Axis 1

Ravi Danum
Ranch Hand

Joined: Jan 13, 2009
Posts: 104
Hello,

I am building a web service and client to access the web service.

I am using AXIS 1.

I want to use client authentication with a certificate.

What steps must I follow to configure the web service and the client to achieve this?

Thanks in advance.

-Rava
James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
If all you want is to make HTTPS WebService calls - this should be no different from making any other https call (webservice or not).

Make sure that the app server is configured to accept HTTPS calls.
From the calling application invoke WebService with HTTPS protocol - how to do this really depends on what kind of client code you have.

There is some information here:
http://forums.sun.com/thread.jspa?threadID=5384334

Ravi Danum
Ranch Hand

Joined: Jan 13, 2009
Posts: 104
Hello,

Thanks for the reply and link. So far I have modified Tomcat server.xml to uncomment the https connector, and I have created the SSL certificate using:
keytool -genkey -alias tomcat -keyalg RSA.

I changed the client code to access the web service by changing the port and http to https.

On the client machine I also ran: keytool -genkey -alias tomcat -keyalg RSA

Do I need to export the certificate from the client and send the file to the web server? I want to use the certificate to authenticate the client. If I only want to authenticate the client and not the server, does the server still have to run the keytool to create a certificate? Also, I'm not sure how to set the properties on the client side.

I would greatly appreciate any help getting answers to these questions.

-Rava



James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
See this link:
http://www.j2ee-security.net/book/sample-chap/

Download the pdf, and see page 16 - SSL Security for WebServices.

Ravi Danum
Ranch Hand

Joined: Jan 13, 2009
Posts: 104
Thanks, James. I will read it now.

-Ravi
Ravi Danum
Ranch Hand

Joined: Jan 13, 2009
Posts: 104
Hi James,

I have looked at the documentation. I have two questions regarding keytool:

1) The document uses: keytool -export, keytool -import, and keytool -genkey. The current jdk 1.6 uses: keytool -exportcert, keytool -importcert, and keytool -genkeypair.

2) The newer examples I've seen use an alias in the commands. If an alias is used, how would this affect the client code when setting up the properties?

Thanks.

-Ravi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: please answer - client authentication with certificate in Axis 1