This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Authentication via HttpUrlConnection

 
Bill Siggelkow
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Carl Trusiak
Sheriff
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic