• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Setting WEb services credentials

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am calling a .NET Web service that uses NTLM authentication. How do I pass the credentials to the web service from my JAX-RPC Client.
thanks,
Ravi
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Google-ing a bit gave me some good links. You may check that as well.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Given that there is no official specification for NTLM (this is the closest description) support of NTLM in combination with JAX-RPC would be highly vendor dependent.

If you are bound to using NTLM then using an Axis2 client would the easiest route. Axis2 clients use the Jarkarta Commons HttpClient which can deal with NTLM.

Axis2 HTTP Transport: Basic, Digest and NTLM Authentication.
 
Ravi Narala
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies. I did go thru those links. Most of them talk about passing credentials using Axis. In this case we have a JAX-RPC client with generated stubs that run on Websphere. I was not sure on cross platform interoperability.

Besides, I came across a class by name sun.net.www.protocol.http.NTLMAuthenication that takes a URL and PasswordAuthentication as parameters. But its got a restricted visibility that does not allow me to import the class. I have the endpoint URL and i was able to build a PasswordAuth object. If I could build the NTLMAuth object I can set this property on the stub. This is where I am stuck.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suspect that is an internal class that is instantiated once the "WWW-Authenticate: NTLM" header is seen. Apparently you need to set up a subclass of java.net.Authenticator to return the required authentication information (see Http Authentication) and then set it as the default by calling java.net.Authenticator.setDefault(myAuthenticator). Of course this will only work if your JAX-RPC implementation actually uses the java.net.HttpURLConnection class.

Then again it may just be a matter of setting the correct properties as there is a http.auth.ntlm.domain property (see Networking Properties).
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic