The moose likes Sockets and Internet Protocols and the fly likes Authentication via HttpUrlConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Authentication via HttpUrlConnection" Watch "Authentication via HttpUrlConnection" New topic
Author

Authentication via HttpUrlConnection

Bill Siggelkow
Ranch Hand

Joined: Jun 27, 2001
Posts: 57
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.


Bill Siggelkow
Jade Cove Solutions
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
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


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Authentication via HttpUrlConnection
 
Similar Threads
Cant use object from another class
Posting to bump up my count...
WA #1.....word association
The x900 effect ?
Text box value is not being completely filled with request attribute