You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ash <ja...@gmail.com> on 2013/09/22 01:41:00 UTC

Re: basic authentication in cxf webservice client

How do I setup digest auth type to webservice client using cxf?



Re: basic authentication in cxf webservice client

Posted by Ash Ashkj <ja...@gmail.com>.
Hi Andrei,

Thanks very much for your assistance. It works.
I really appreciate your time and help.

Many thanks,
Ashwini


On Tue, Sep 24, 2013 at 8:38 AM, Andrei Shakirin <as...@talend.com>wrote:

>  Hi,****
>
> ** **
>
> You can do it for example this way:****
>
> ** **
>
>         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();****
>
>         factory.setAddress("http://localhost:9000/CustomerService");****
>
>         CustomerService customerClient =
> factory.create(CustomerService.class);****
>
>         Client client = ClientProxy.getClient(customerClient);****
>
> ** **
>
>         HTTPConduit http =  (HTTPConduit) client.getConduit();****
>
>         AuthorizationPolicy authPolicy = new AuthorizationPolicy();****
>
>         authPolicy.setAuthorizationType("Digest");****
>
>         authPolicy.setUserName("foo");****
>
>         authPolicy.setPassword("bar");****
>
>         http.setAuthorization(authPolicy);****
>
>        …****
>
> ** **
>
> Regards,****
>
> Andrei.****
>
> ** **
>
> *From:* Ash Ashkj [mailto:jainashwini@gmail.com <ja...@gmail.com>]
> *Sent:* Sonntag, 22. September 2013 18:20
> *To:* Andrei Shakirin
> *Cc:* users@cxf.apache.org
>
> *Subject:* Re: basic authentication in cxf webservice client****
>
>  ** **
>
> Thanks very much Andrei!****
>
> How do I implement similar test using JaxWsProxyFactoryBean ?****
>
> I have implemented basic,x509 message level and transfer-layer level auth
> using JaxWsProxyFactoryBean but not getting any clue about digest auth.***
> *
>
> ** **
>
> Many Thanks,****
>
> Ash****
>
> ** **
>
> On Sun, Sep 22, 2013 at 4:45 PM, Andrei Shakirin <as...@talend.com>
> wrote:****
>
> Hi,
>
> You can take following system test as a basis:
> https://svn.apache.org/repos/asf/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/auth/DigestAuthTest.java
>
> Regards,
> Andrei.
>
> > -----Original Message-----
> > From: ash [mailto:jainashwini@gmail.com]
> > Sent: Sonntag, 22. September 2013 01:41
> > To: users@cxf.apache.org
> > Subject: Re: basic authentication in cxf webservice client
> >
> > How do I setup digest auth type to webservice client using cxf?
> >****
>
> ** **
>

RE: basic authentication in cxf webservice client

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

You can do it for example this way:

        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setAddress("http://localhost:9000/CustomerService");
        CustomerService customerClient = factory.create(CustomerService.class);
        Client client = ClientProxy.getClient(customerClient);

        HTTPConduit http =  (HTTPConduit) client.getConduit();
        AuthorizationPolicy authPolicy = new AuthorizationPolicy();
        authPolicy.setAuthorizationType("Digest");
        authPolicy.setUserName("foo");
        authPolicy.setPassword("bar");
        http.setAuthorization(authPolicy);
       ...

Regards,
Andrei.

From: Ash Ashkj [mailto:jainashwini@gmail.com]
Sent: Sonntag, 22. September 2013 18:20
To: Andrei Shakirin
Cc: users@cxf.apache.org<ma...@cxf.apache.org>
Subject: Re: basic authentication in cxf webservice client

Thanks very much Andrei!
How do I implement similar test using JaxWsProxyFactoryBean ?
I have implemented basic,x509 message level and transfer-layer level auth using JaxWsProxyFactoryBean but not getting any clue about digest auth.

Many Thanks,
Ash

On Sun, Sep 22, 2013 at 4:45 PM, Andrei Shakirin <as...@talend.com>> wrote:
Hi,

You can take following system test as a basis: https://svn.apache.org/repos/asf/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/auth/DigestAuthTest.java

Regards,
Andrei.

> -----Original Message-----
> From: ash [mailto:jainashwini@gmail.com<ma...@gmail.com>]
> Sent: Sonntag, 22. September 2013 01:41
> To: users@cxf.apache.org<ma...@cxf.apache.org>
> Subject: Re: basic authentication in cxf webservice client
>
> How do I setup digest auth type to webservice client using cxf?
>


RE: basic authentication in cxf webservice client

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

You can take following system test as a basis: https://svn.apache.org/repos/asf/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/auth/DigestAuthTest.java

Regards,
Andrei.

> -----Original Message-----
> From: ash [mailto:jainashwini@gmail.com]
> Sent: Sonntag, 22. September 2013 01:41
> To: users@cxf.apache.org
> Subject: Re: basic authentication in cxf webservice client
> 
> How do I setup digest auth type to webservice client using cxf?
>