• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Authentication via HttpUrlConnection

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anyone successfully used the Authenticator class? I tried this from a client app and it did not seem to work. Instead, I simply stored the username and password as base64 encoded strings in the request. I am connecting to a servlet running on WLS 6.1.
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Authenticator class (I assume you are using the one from OReilly) encodes the Authentication information in the http request header. The Server or Servlet has to be configured to accept the authentication in this manner. If when you connect using a browser, a popup window is displayed for username and password, you can be fairly sure it's configured that way. If you want information on writing a servlet that reads the Basic Authentication from a http request header, I recommend you post the question in Serlvet forum.
------------------
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
reply
    Bookmark Topic Watch Topic
  • New Topic