You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Thoren Johne <th...@southern-division.de> on 2001/12/10 10:41:24 UTC

http_headers_out

is it possible to send a 'unauthorized' - 401 header from an embperl page?

i tried $http_headers_out{'unauthorized'} = '401', without success.

i'd like to have a user-authentification without using a '.htaccess' file

regards
thoren
8#X


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: http_headers_out

Posted by Gerald Richter <ri...@ecos.de>.
>
> both Crypt_DES and Plaintext work, but i have to authenticate
> 3 times to get access.
>

I don't know how Crypt_DES  works, but some auth methods requires challage
and response which needs more then just one request. I guess you have to
more closely watch what Crypt_DES is doing and compare it to what your pages
do.

The easiest way to do this to use a network sniffer ethereal
(www.etheral.org) is a great tool for that

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: http_headers_out

Posted by Thoren Johne <th...@southern-division.de>.
----- Original Message ----- 
From: "Gerald Richter" <ri...@ecos.de>
To: "Thoren Johne" <th...@southern-division.de>; <em...@perl.apache.org>
Sent: Tuesday, December 11, 2001 12:00 PM
Subject: Re: http_headers_out


> > the method via err_header_out only allows me to authenticate with
> > Crypt_DES accounts, while using .htaccess im able to use both
> > Plaintext and Crypt_DES accounts.
> >
> 
> Your WWW-Autheticate needs another method added, additional to Basic.
> Watch the http header that gets send when you use it via .htaccess
> and modifiy yours accordingly

that's what i tought too, but the headers are identical.

meanwhile i found that the problem was different than what
i thought first (sorry):

both Crypt_DES and Plaintext work, but i have to authenticate
3 times to get access.

the page uses EmbperlObject, and there ist no other element
on the page itself. i removed all Executes from the EmbperlObject
Startpage (but the one that calls the page itself), same thing - i
need to authenticate 3 times.

regards
thoren
8#X


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: http_headers_out

Posted by Gerald Richter <ri...@ecos.de>.
>
> ok, that works ... partial :)
>
> i do use mod_auth_mysql with
> Auth_MySQL_Enctyption_Types Plaintext Crypt_DES
> - configured that way in httpd.conf, not in the .htaccess file
>
> the method via err_header_out only allows me to authenticate with
Crypt_DES
> accounts, while using .htaccess im able to use both Plaintext and
> Crypt_DES accounts.
>

Your WWW-Autheticate needs another method added, additional to Basic. Watch
the http header that gets send when you use it via .htaccess and modifiy
yours accordingly

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: http_headers_out

Posted by Thoren Johne <th...@southern-division.de>.
----- Original Message -----
From: "Gerald Richter" <ri...@ecos.de>
To: "Thoren Johne" <th...@southern-division.de>; <em...@perl.apache.org>
Sent: Tuesday, December 11, 2001 8:14 AM
Subject: Re: http_headers_out


> > i'd like to have a user-authentification without using a '.htaccess'
file
> >
>
> 401 is a status code not a http header, so you need to say (assuming you
> running under mod_perl):
>
> $req_rec -> status (401) ;
>
> and additionaly tell the browser which auth method and realm you want to
> use:
>
> $req_rec -> err_header_out('WWW-Authenticate', 'Basic realm=<realmtext>')
;

ok, that works ... partial :)

i do use mod_auth_mysql with
Auth_MySQL_Enctyption_Types Plaintext Crypt_DES
- configured that way in httpd.conf, not in the .htaccess file

the method via err_header_out only allows me to authenticate with Crypt_DES
accounts, while using .htaccess im able to use both Plaintext and
Crypt_DES accounts.

any hints, ideas?

regards
thoren
8#X


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: http_headers_out

Posted by Gerald Richter <ri...@ecos.de>.

> is it possible to send a 'unauthorized' - 401 header from an embperl page?
>

I didn't have tried it, but I don't see any reason why it shouldn't work.

> i tried $http_headers_out{'unauthorized'} = '401', without success.
>
> i'd like to have a user-authentification without using a '.htaccess' file
>

401 is a status code not a http header, so you need to say (assuming you
running under mod_perl):

$req_rec -> status (401) ;

and additionaly tell the browser which auth method and realm you want to
use:

$req_rec -> err_header_out('WWW-Authenticate', 'Basic realm=<realmtext>') ;

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org