AW: AUTH password

<[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <28C10D22E644C84AB27BCF443218045A34A17DD1E9@HE111523.emea1.cds.t-internal.com>
[email protected] wrote:
> [email protected] wrote:
> > Hello,
> >
> > I am looking for a way to retrieve the AUTH password, without using mod_rewrite ...
>
> I'd be interested in how you would do it, using mod_rewrite.
> For my personal education..

mod_rewrite is really powerful, you are able to pass any header information to any output.
I just tried the following rule, it just appends the header to the GET Request.

 RewriteEngine On
 RewriteRule (.*) $1?HTTP_Authorization=%{HTTP:Authorization} [PT]

Or pass it to ENV:
 RewriteRule / - [PT,E=HTTP_Authorization:%{HTTP:Authorization}]

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

In PHP you just need a single line to decode it:
 var_dump(base64_decode(str_replace('Basic ', '', $_REQUEST['HTTP_Authorization'])));

 var_dump(base64_decode(str_replace('Basic ', '', $_SERVER['HTTP_Authorization'])));

And please do not talk about security, it is just base64, if there is no SSL, anyone in the middle is able to read the password.

Greetings,
Alexander
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.