You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by hcene <ah...@hotmail.fr> on 2012/01/24 17:39:51 UTC

Digest Authentification CXF IIS Java 1.5

Hi,
Can you please tell me if is it possible to make Digest Authentification on
IIS server under java 5 with CXF?
please help

--
View this message in context: http://cxf.547215.n5.nabble.com/Digest-Authentification-CXF-IIS-Java-1-5-tp5309180p5309180.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Digest Authentification CXF IIS Java 1.5

Posted by hcene <ah...@hotmail.fr>.
Thanks Dan !!
I do it by something like this:


import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
.....

Authenticator.setDefault(new Authenticator() {
			@Override
			protected PasswordAuthentication getPasswordAuthentication() {
				return new PasswordAuthentication("mylogin", "secretpwd"
						.toCharArray());
			}
		});

		Service service = new MyService();
		Port myport= service.getPort();

		Client client = ClientProxy.getClient(myport);
		HTTPConduit http = (HTTPConduit) client.getConduit();
		HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
		httpClientPolicy.setConnectionTimeout(1000);
		httpClientPolicy.setAllowChunking(false);
		httpClientPolicy.setAutoRedirect(true);
		http.setClient(httpClientPolicy);
                InParam params = new InParam ();
                .....		
		OutParam reponses = myport.getMyMethod(params);






--
View this message in context: http://cxf.547215.n5.nabble.com/Digest-Authentification-CXF-IIS-Java-1-5-tp5309180p5432853.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Digest Authentification CXF IIS Java 1.5

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday, January 24, 2012 8:39:51 AM hcene wrote:
> Hi,
> Can you please tell me if is it possible to make Digest Authentification on
> IIS server under java 5 with CXF?
> please help


You should just need to setup an http:conduit 
(see: 
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
)

To configure digest auth.  Something like:

<http:conduit name="http://localhost.*">
   <http:authorization>
      <http:AuthorizationType>Digest</http:AuthorizationType>
   </http:authorization>
 </http:conduit>

or via code as described on the page.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com