Thanks for your help. It pointed me in the right direction, though it still
doesn't quite work. Here are the entries I made in my httpd.conf:
RewriteLog /opt/asn/logs/rewrite.log
RewriteLogLevel 5
RewriteCond %{LA-U:REMOTE_USER} ^(.*)@COMPANY.COM$
RewriteRule /.* - [E=REMOTE_USER:%1]
My intent is to modify the REMOTE_USER variable to drop the Kerberos Realm
name. This seems to work correctly from the apache log entry:
10.1.12.70 - - [04/Oct/2006:13:48:45 --0700] [
server1.company.com/sid#81ec8][rid#16c660/initial] (5) lookahead:
path=/oasis/preproduction/htdocs/gifs/oasis-home.gif var=REMOTE_USER -> val=
gdwfkd@COMPANY.COM
10.1.12.70 - - [04/Oct/2006:13:48:45 --0700] [
server1.company.com/sid#81ec8][rid#16c660/initial] (4) RewriteCond: input='
gdwfkd@COMPANY.COM' pattern='^(.*)@COMPANY.COM$' => matched
10.1.12.70 - - [04/Oct/2006:13:48:45 --0700] [
server1.company.com/sid#81ec8][rid#16c660/initial] (5) setting env variable
'REMOTE_USER' to 'gdwfkd'
but the variable that gets passed to the CGI script still has the realm name
append to it.
Any help would be appreciated.
On 10/3/06, Rob Wilkerson <r.d.wilkerson@gmail.com> wrote:
>
>
> On Oct 3, 2006, at 7:08 PM, Jason Lingel wrote:
>
> > Is there a way to modify an environment variable that gets passed
> > to a CGI? For example, I'm doing Kerberos authentication and the
> > realm gets appended to the REMOTE_USER variable, e.g., REMOTE_USER=
> > username@MYCOMPANY.COM. I just want username and not the realm. I
> > would prefer not to do this in the CGI because the CGIs are already
> > written (legacy in house application).
> >
> > TIA.
> >
> I just did this using mod_rewrite by setting the E flag.
>
> RewriteRule /.* - [E=varname:value]
>
> In my case, I needed to pass the request uri to ColdFusion (which
> doesn't appear to pass it along as it should). I did so using this
> capability (I was already using mod_rewrite).
>
> RewriteRule /.* /my/redirect.cfm [E=MY_REQUEST_URI:%{REQUEST_URI},PT]
>
> Worked like a charm.
>
> Hope this helps.
>
> ---------------------------------------------------------------------
> 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
>
>
|