You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ma...@llbc.de on 2005/04/15 12:58:00 UTC

[users@httpd] RequestHeader set Problem

Hi,

Apache 2.0.53 with mod_proxy gets Requests from Clients, Requests are send to
the Backendsystem.

In one case, the User is authenticated by Apache using SSL Clientcertificate.

In another case, users without clinetcertificate can use Basic
Auth(mod_auth_ldap) for authentication. 

Authorisation is done completle in the Backendsystem. Apache writes an extra
Header "USER_ID" when authentication is done. Value of this header is the
username. The Header USER_ID is used by Backendsystem to authorize the User.

Now the Problem:  

Working:
RequestHeader set "USER_ID" %{SSL_CLIENT_S_DN_CN}e

Not working:
RequestHeader set "USER_ID" %{REMOTE_USER}e
in this case, the Header USER_ID is set, but value is (null).

The Apache ENV Var REMOTE_USER is filled correctly, bacuse i can see the right
value in the Log. (RemUser: %{REMOTE_USER}x)

So why the Header can't be filled with %{REMOTE_USER}e ?

Friendly Regards
Chrisitan

--
                                                      /\
------------------------------------------------   /\/  \/\
  Powerd by llbc.de - letz board it, yeahhh !!    /  \ \ \ \
-----------------------------------------------  /  / \   \




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RequestHeader set Problem

Posted by ma...@llbc.de.
Great, it's working. 

Thanks a lot.



Quoting Brian Hughes '89 <br...@Alum.Dartmouth.ORG>:

> On Apr 15, 2005, at 06:58 AM, masro@llbc.de wrote:
> > Working:
> > RequestHeader set "USER_ID" %{SSL_CLIENT_S_DN_CN}e
> >
> > Not working:
> > RequestHeader set "USER_ID" %{REMOTE_USER}e
> > in this case, the Header USER_ID is set, but value is (null).
> >
> > The Apache ENV Var REMOTE_USER is filled correctly, bacuse i can see 
> > the right
> > value in the Log. (RemUser: %{REMOTE_USER}x)
> >
> > So why the Header can't be filled with %{REMOTE_USER}e ?
> 
> I've seen this happen in several instances. I can't really tell you why 
> RequestHeader can't grab the value from the REMOTE_USER environment 
> variable. Maybe there's a namespace issue that I don't understand, I'm 
> not sure. What I can do is give you the necessary mod_rewrite 
> statements that will get you the value. I had the same problem with 
> getting the REMOTE_PORT value.
> 
> RewriteEngine On
> RewriteCond %{REMOTE_PORT} (.*)
> RewriteRule .* - [E=R_P:%1]
> 
> RequestHeader add X-Remote-Port %{R_P}e
> 
> 
> Give this a try...
> 
> -Brian
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



--
                                                      /\
------------------------------------------------   /\/  \/\
  Powerd by llbc.de - letz board it, yeahhh !!    /  \ \ \ \
-----------------------------------------------  /  / \   \




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RequestHeader set Problem

Posted by Brian Hughes '89 <br...@Alum.Dartmouth.ORG>.
On Apr 15, 2005, at 06:58 AM, masro@llbc.de wrote:
> Working:
> RequestHeader set "USER_ID" %{SSL_CLIENT_S_DN_CN}e
>
> Not working:
> RequestHeader set "USER_ID" %{REMOTE_USER}e
> in this case, the Header USER_ID is set, but value is (null).
>
> The Apache ENV Var REMOTE_USER is filled correctly, bacuse i can see 
> the right
> value in the Log. (RemUser: %{REMOTE_USER}x)
>
> So why the Header can't be filled with %{REMOTE_USER}e ?

I've seen this happen in several instances. I can't really tell you why 
RequestHeader can't grab the value from the REMOTE_USER environment 
variable. Maybe there's a namespace issue that I don't understand, I'm 
not sure. What I can do is give you the necessary mod_rewrite 
statements that will get you the value. I had the same problem with 
getting the REMOTE_PORT value.

RewriteEngine On
RewriteCond %{REMOTE_PORT} (.*)
RewriteRule .* - [E=R_P:%1]

RequestHeader add X-Remote-Port %{R_P}e


Give this a try...

-Brian


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org