Re: Change authentication information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 27, 2010 at 4:29 PM, Tom Evans <tevans.uk@xxxxxxxxxxxxxx> wrote:
> On Tue, Apr 27, 2010 at 4:06 PM, Tamas, Gabor <almaalmaalma@xxxxxxxxxx> wrote:
>>
>> Hi,
>>
>> i' ve two machines, (A) is on the Internet site, which is a reverse proxy
>> for (B). There is a user based authentication, and i' d like (A) to change
>> the authentication details (only the username). So, for example if john
>> comes, and tries to authenticate itself as john on server (A), i' d like (A)
>> to change the username to ext-john. It should be transparent for (B), so (B)
>> should get only ext-john as a username. If there' s any other solution,
>> please let me know.
>>
>> Anyway, i tried to find a solution with mod_header and mod_sed, but the
>> latest one cannot change the header, and the former one, well, with that i
>> couldn' t catch the username.
>>
>> I hope there' s a simplier way to do it, than learn how to write an apache
>> modul, and write my own.
>>
>> Thank You for any comment,
>>  Tamas.
>
> I don't have a sample config that does this, but the principle is as follows:
>
> # Use RewriteCond to capture the user name - LookAhead, as auth
> happens after rewrite
> # Dont use LA-U in .htaccess, as rewrite in .htaccess happens after
> auth (so not needed)
> RewriteCond %{LA-U:REMOTE_USER} ^(.*)$
> # Use RewriteRule to put that into an env variable
> RewriteRule ^(.*) - [env=remote_user:%1]
> # Use RequestHeader to update the request's headers to include our env variable
> RequestHeader set X-Remote-User ext-%{remote_user}e
>
> Like I said, not tested!
>
> Cheers
>
> Tom

Also, obviously, the backend then must parse the REMOTE_USER from the
header X-Remote-User.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux