You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by mh <mh...@reflexe.fr> on 2002/03/21 16:10:41 UTC

Apache Tomcat response.setHeader("WWW-Authenticate","BASIC

I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform.

I try to do this in a servlet :

String authHeader = request.getHeader("Authorization");
if (authHeader != null) {
 AuthInternaute ai = new AuthInternaute(authHeader);
 String username = ai.getUsername();
 String password = ai.getPassword();
 allow = (validUsername.equals(username) && validPassword.equals(password));
}
else
{
 response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\"");
 response.sendError(response.SC_UNAUTHORIZED, "Identification required / Autorisation nécessaire."); 
}

but Apache doesn't respond correctly and send an "Internal Server Error" instead of authentication dialog box.

It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't know how to solve this problem.

Can someone have ideas ?

M.H.

Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC

Posted by mh <mh...@reflexe.fr>.
I do : wget -s and I see this :

--16:57:34--  http://dev.cerib.reflexe.fr/cerib_BDAdmin
           => `cerib_BDAdmin'
Connexion vers dev.cerib.reflexe.fr:80...Connecté!
requête HTTP transmise, en attente de la réponse...302 Found
Location: http://dev.cerib.reflexe.fr/cerib/cerib_BDAdmin [suivant]
--16:57:34--  http://dev.cerib.reflexe.fr/cerib/cerib_BDAdmin
           => `cerib_BDAdmin'
Connexion vers dev.cerib.reflexe.fr:80...Connecté!
requête HTTP transmise, en attente de la réponse...500 Internal Server Error
16:57:34 ERREUR 500: Internal Server Error.


----- Original Message -----
From: "mh" <mh...@reflexe.fr>
To: <to...@jakarta.apache.org>
Sent: Thursday, March 21, 2002 4:10 PM
Subject: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC


I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform.

I try to do this in a servlet :

String authHeader = request.getHeader("Authorization");
if (authHeader != null) {
 AuthInternaute ai = new AuthInternaute(authHeader);
 String username = ai.getUsername();
 String password = ai.getPassword();
 allow = (validUsername.equals(username) && validPassword.equals(password));
}
else
{
 response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\"");
 response.sendError(response.SC_UNAUTHORIZED, "Identification required /
Autorisation nécessaire.");
}

but Apache doesn't respond correctly and send an "Internal Server Error"
instead of authentication dialog box.

It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't know
how to solve this problem.

Can someone have ideas ?

M.H.



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC

Posted by David Cassidy <dc...@nisports.com>.
Can I see the headers ?

mh wrote:

>It works fine with tomcat standalone tomcat port 8080
>
>----- Original Message -----
>From: "David Cassidy" <dc...@nisports.com>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Sent: Thursday, March 21, 2002 4:40 PM
>Subject: Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC
>
>
>>What do you get if you connect to the tomcat 8080 port and
>>do the same thing ?
>>
>>D
>>
>>
>>mh wrote:
>>
>>>--16:17:44--  http://dev.cerib.reflexe.fr/cerib_BD
>>>          => `cerib_BD'
>>>Connexion vers dev.cerib.reflexe.fr:80...Connecté!
>>>requête HTTP transmise, en attente de la réponse...302 Found
>>>2 Date: Thu, 21 Mar 2002 15:17:44 GMT
>>>3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
>>>mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
>>>4 Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD
>>>5 Connection: close
>>>6 Content-Type: text/html; charset=iso-8859-1
>>>7
>>>Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD [suivant]
>>>--16:17:44--  http://dev.cerib.reflexe.fr/cerib/cerib_BD
>>>          => `cerib_BD'
>>>Connexion vers dev.cerib.reflexe.fr:80...Connecté!
>>>requête HTTP transmise, en attente de la réponse...500 Internal Server
>>>
>Error
>
>>>2 Date: Thu, 21 Mar 2002 15:17:44 GMT
>>>3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
>>>mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
>>>4 Connection: close
>>>5 Content-Type: text/html; charset=iso-8859-1
>>>6
>>>16:17:44 ERREUR 500: Internal Server Error.
>>>
>>>
>>>----- Original Message -----
>>>From: "David Cassidy" <dc...@nisports.com>
>>>To: "Tomcat Users List" <to...@jakarta.apache.org>
>>>Sent: Thursday, March 21, 2002 4:11 PM
>>>Subject: Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC
>>>
>>>
>>>>can you send the full set of headers that you get back ?
>>>>
>>>>wget -s
>>>>will do this ..
>>>>
>>>>D
>>>>
>>>>
>>>>
>>>>mh wrote:
>>>>
>>>>>I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform.
>>>>>
>>>>>I try to do this in a servlet :
>>>>>
>>>>>String authHeader = request.getHeader("Authorization");
>>>>>if (authHeader != null) {
>>>>>AuthInternaute ai = new AuthInternaute(authHeader);
>>>>>String username = ai.getUsername();
>>>>>String password = ai.getPassword();
>>>>>allow = (validUsername.equals(username) &&
>>>>>validPassword.equals(password));
>>>>>}
>>>>>else
>>>>>{
>>>>>response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\"");
>>>>>response.sendError(response.SC_UNAUTHORIZED, "Identification required /
>>>>>Autorisation nécessaire.");
>>>>>}
>>>>>
>>>>>but Apache doesn't respond correctly and send an "Internal Server
>>>>>
>Error"
>
>>>>>instead of authentication dialog box.
>>>>>
>>>>>It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't
>>>>>know how to solve this problem.
>>>>>
>>>>>Can someone have ideas ?
>>>>>
>>>>>M.H.
>>>>>
>>>>
>>>>--
>>>>To unsubscribe:   <ma...@jakarta.apache.org>
>>>>For additional commands: <ma...@jakarta.apache.org>
>>>>Troubles with the list: <ma...@jakarta.apache.org>
>>>>
>>>
>>>--
>>>To unsubscribe:   <ma...@jakarta.apache.org>
>>>For additional commands: <ma...@jakarta.apache.org>
>>>Troubles with the list: <ma...@jakarta.apache.org>
>>>
>>
>>
>>--
>>To unsubscribe:   <ma...@jakarta.apache.org>
>>For additional commands: <ma...@jakarta.apache.org>
>>Troubles with the list: <ma...@jakarta.apache.org>
>>
>
>
>--
>To unsubscribe:   <ma...@jakarta.apache.org>
>For additional commands: <ma...@jakarta.apache.org>
>Troubles with the list: <ma...@jakarta.apache.org>
>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC

Posted by mh <mh...@reflexe.fr>.
It works fine with tomcat standalone tomcat port 8080

----- Original Message -----
From: "David Cassidy" <dc...@nisports.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, March 21, 2002 4:40 PM
Subject: Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC


>
> What do you get if you connect to the tomcat 8080 port and
> do the same thing ?
>
> D
>
>
> mh wrote:
>
> >--16:17:44--  http://dev.cerib.reflexe.fr/cerib_BD
> >           => `cerib_BD'
> >Connexion vers dev.cerib.reflexe.fr:80...Connecté!
> >requête HTTP transmise, en attente de la réponse...302 Found
> >2 Date: Thu, 21 Mar 2002 15:17:44 GMT
> >3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
> >mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
> >4 Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD
> >5 Connection: close
> >6 Content-Type: text/html; charset=iso-8859-1
> >7
> >Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD [suivant]
> >--16:17:44--  http://dev.cerib.reflexe.fr/cerib/cerib_BD
> >           => `cerib_BD'
> >Connexion vers dev.cerib.reflexe.fr:80...Connecté!
> >requête HTTP transmise, en attente de la réponse...500 Internal Server
Error
> >2 Date: Thu, 21 Mar 2002 15:17:44 GMT
> >3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
> >mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
> >4 Connection: close
> >5 Content-Type: text/html; charset=iso-8859-1
> >6
> >16:17:44 ERREUR 500: Internal Server Error.
> >
> >
> >----- Original Message -----
> >From: "David Cassidy" <dc...@nisports.com>
> >To: "Tomcat Users List" <to...@jakarta.apache.org>
> >Sent: Thursday, March 21, 2002 4:11 PM
> >Subject: Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC
> >
> >
> >>can you send the full set of headers that you get back ?
> >>
> >>wget -s
> >>will do this ..
> >>
> >>D
> >>
> >>
> >>
> >>mh wrote:
> >>
> >>>I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform.
> >>>
> >>>I try to do this in a servlet :
> >>>
> >>>String authHeader = request.getHeader("Authorization");
> >>>if (authHeader != null) {
> >>>AuthInternaute ai = new AuthInternaute(authHeader);
> >>>String username = ai.getUsername();
> >>>String password = ai.getPassword();
> >>>allow = (validUsername.equals(username) &&
> >>>validPassword.equals(password));
> >>>}
> >>>else
> >>>{
> >>>response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\"");
> >>>response.sendError(response.SC_UNAUTHORIZED, "Identification required /
> >>>Autorisation nécessaire.");
> >>>}
> >>>
> >>>but Apache doesn't respond correctly and send an "Internal Server
Error"
> >>>instead of authentication dialog box.
> >>>
> >>>It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't
> >>>know how to solve this problem.
> >>>
> >>>Can someone have ideas ?
> >>>
> >>>M.H.
> >>>
> >>
> >>
> >>--
> >>To unsubscribe:   <ma...@jakarta.apache.org>
> >>For additional commands: <ma...@jakarta.apache.org>
> >>Troubles with the list: <ma...@jakarta.apache.org>
> >>
> >
> >
> >--
> >To unsubscribe:   <ma...@jakarta.apache.org>
> >For additional commands: <ma...@jakarta.apache.org>
> >Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC

Posted by David Cassidy <dc...@nisports.com>.
What do you get if you connect to the tomcat 8080 port and
do the same thing ?

D


mh wrote:

>--16:17:44--  http://dev.cerib.reflexe.fr/cerib_BD
>           => `cerib_BD'
>Connexion vers dev.cerib.reflexe.fr:80...Connecté!
>requête HTTP transmise, en attente de la réponse...302 Found
>2 Date: Thu, 21 Mar 2002 15:17:44 GMT
>3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
>mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
>4 Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD
>5 Connection: close
>6 Content-Type: text/html; charset=iso-8859-1
>7
>Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD [suivant]
>--16:17:44--  http://dev.cerib.reflexe.fr/cerib/cerib_BD
>           => `cerib_BD'
>Connexion vers dev.cerib.reflexe.fr:80...Connecté!
>requête HTTP transmise, en attente de la réponse...500 Internal Server Error
>2 Date: Thu, 21 Mar 2002 15:17:44 GMT
>3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
>mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
>4 Connection: close
>5 Content-Type: text/html; charset=iso-8859-1
>6
>16:17:44 ERREUR 500: Internal Server Error.
>
>
>----- Original Message -----
>From: "David Cassidy" <dc...@nisports.com>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Sent: Thursday, March 21, 2002 4:11 PM
>Subject: Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC
>
>
>>can you send the full set of headers that you get back ?
>>
>>wget -s
>>will do this ..
>>
>>D
>>
>>
>>
>>mh wrote:
>>
>>>I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform.
>>>
>>>I try to do this in a servlet :
>>>
>>>String authHeader = request.getHeader("Authorization");
>>>if (authHeader != null) {
>>>AuthInternaute ai = new AuthInternaute(authHeader);
>>>String username = ai.getUsername();
>>>String password = ai.getPassword();
>>>allow = (validUsername.equals(username) &&
>>>validPassword.equals(password));
>>>}
>>>else
>>>{
>>>response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\"");
>>>response.sendError(response.SC_UNAUTHORIZED, "Identification required /
>>>Autorisation nécessaire.");
>>>}
>>>
>>>but Apache doesn't respond correctly and send an "Internal Server Error"
>>>instead of authentication dialog box.
>>>
>>>It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't
>>>know how to solve this problem.
>>>
>>>Can someone have ideas ?
>>>
>>>M.H.
>>>
>>
>>
>>--
>>To unsubscribe:   <ma...@jakarta.apache.org>
>>For additional commands: <ma...@jakarta.apache.org>
>>Troubles with the list: <ma...@jakarta.apache.org>
>>
>
>
>--
>To unsubscribe:   <ma...@jakarta.apache.org>
>For additional commands: <ma...@jakarta.apache.org>
>Troubles with the list: <ma...@jakarta.apache.org>
>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC

Posted by mh <mh...@reflexe.fr>.
--16:17:44--  http://dev.cerib.reflexe.fr/cerib_BD
           => `cerib_BD'
Connexion vers dev.cerib.reflexe.fr:80...Connecté!
requête HTTP transmise, en attente de la réponse...302 Found
2 Date: Thu, 21 Mar 2002 15:17:44 GMT
3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
4 Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD
5 Connection: close
6 Content-Type: text/html; charset=iso-8859-1
7
Location: http://dev.cerib.reflexe.fr/cerib/cerib_BD [suivant]
--16:17:44--  http://dev.cerib.reflexe.fr/cerib/cerib_BD
           => `cerib_BD'
Connexion vers dev.cerib.reflexe.fr:80...Connecté!
requête HTTP transmise, en attente de la réponse...500 Internal Server Error
2 Date: Thu, 21 Mar 2002 15:17:44 GMT
3 Server: Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_jk PHP/4.0.1pl2
mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 mod_gzip/1.3.19.1a
4 Connection: close
5 Content-Type: text/html; charset=iso-8859-1
6
16:17:44 ERREUR 500: Internal Server Error.


----- Original Message -----
From: "David Cassidy" <dc...@nisports.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, March 21, 2002 4:11 PM
Subject: Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC


> can you send the full set of headers that you get back ?
>
> wget -s
> will do this ..
>
> D
>
>
>
> mh wrote:
>
> >I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform.
> >
> >I try to do this in a servlet :
> >
> >String authHeader = request.getHeader("Authorization");
> >if (authHeader != null) {
> > AuthInternaute ai = new AuthInternaute(authHeader);
> > String username = ai.getUsername();
> > String password = ai.getPassword();
> > allow = (validUsername.equals(username) &&
> >validPassword.equals(password));
> >}
> >else
> >{
> > response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\"");
> > response.sendError(response.SC_UNAUTHORIZED, "Identification required /
> >Autorisation nécessaire.");
> >}
> >
> >but Apache doesn't respond correctly and send an "Internal Server Error"
> >instead of authentication dialog box.
> >
> >It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't
> >know how to solve this problem.
> >
> >Can someone have ideas ?
> >
> >M.H.
> >
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache Tomcat response.setHeader("WWW-Authenticate","BASIC

Posted by David Cassidy <dc...@nisports.com>.
can you send the full set of headers that you get back ?

wget -s
will do this ..

D



mh wrote:

>I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform.
>
>I try to do this in a servlet :
>
>String authHeader = request.getHeader("Authorization");
>if (authHeader != null) {
> AuthInternaute ai = new AuthInternaute(authHeader);
> String username = ai.getUsername();
> String password = ai.getPassword();
> allow = (validUsername.equals(username) &&
>validPassword.equals(password));
>}
>else
>{
> response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\"");
> response.sendError(response.SC_UNAUTHORIZED, "Identification required /
>Autorisation nécessaire."); 
>}
>
>but Apache doesn't respond correctly and send an "Internal Server Error"
>instead of authentication dialog box.
>
>It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't
>know how to solve this problem.
>
>Can someone have ideas ?
>
>M.H.
>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>