httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] Apache Basic Authorization and Java
Date Thu, 29 Aug 2002 10:18:04 GMT
To see why this is happening, you need to understand how authentication works. To access the
protected directory, all requests need to provide the Authorization header containing the
username and password. This holds whether the request is from a browser or a java client.

Presumably your java client is making a request from the server - so it has to authenticate
itself. You are lucky that the VM class which handles the socket recognises the 401 response
and prompts you - I would have expected just an exception...

To allow the java client to authenticate itself without prompting, you could build-in the
Authorization header in the jave client (you need to add the line below to the request header):

Authorization: BASIC <base64-encoded user/pass here>


Owen Boyle

>-----Original Message-----
>From: Skladovs, Victor []
>Sent: Donnerstag, 29. August 2002 12:01
>Subject: [users@httpd] Apache Basic Authorization and Java
>Dear Friends!
>I have a problem with Apache Basic Authorization and Java Plug-In when
>using the latest version of Netscape and Internet Explorer 
>with Sun java
>I am not sure of being here right, but all my applies to Sun Forums and
>other related user groups failed :-(((
>I'll try to explain the situation as clear as possible:
>I'm using the Basic Authorization Scheme from Apache 1.3.26.
>After logging in on the Web-server, I try to call my applet which
>communicates with the application server through servlets (I use
>Tomcat-4.0.4-LE as a servlet container).
>When pressing the link from which an applet and a servlet are being
>called, I get a Log-In Dialog again, but this time - from Java Plug-In.
>although I had been already authenticated myself! 
>I have this problem only with the latest version of Netscape and with
>all versions of Internet Explorer with SUN VM. When changing to
>Microsoft VM in IE settings the problem dissappeared. But I'd like to
>use the VM from SUN ...
>For the Netscape I haven't found any solution at all. The 
>worst thing is
>that I can't understand the nature of this "double" (one from Apache,
>another from Java) authorization... Why doesn't Java know that 
>I've been
>already authenticated myself? Can I give Java this information at all?
>I'm using Java 1.4.0_01.
>Could anybody point me in the right direction?
>Thanks in advance
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:> for more info.
>To unsubscribe, e-mail:
>   "   from the digest:
>For additional commands, e-mail:

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message