If I take the rewrite out of the <location> block then NTLM auth fails as the username is re-written and isn't a valid corporate username. On the plus side, If I just set "RequestHeader set REMOTE_USER smithiesr" then I get logged in as I should. --Russell -----Original Message----- From: Assaf Gordon [mailto:gordon@cshl.edu] Sent: Wednesday, 18 July 2012 9:59 a.m. To: Smithies, Russell Cc: galaxy-dev@lists.bx.psu.edu Subject: Re: [galaxy-dev] NTLM auth not passing http_remote_user? Hello Russell, Smithies, Russell wrote, On 07/17/2012 05:41 PM:
It appears that NTLM isn't passing the HTTP_REMOTE_USER through for us. Anyone else struck this and found a solution?
Our apache config looks like this:
<Location "/"> AuthName "Galaxy" NTLMAuth on NTLMAuthHelper "/usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp" NTLMBasicAuthoritative on AuthType NTLM require valid-user
# Take the $REMOTE_USER environment variable and set it as a header in the proxy request. RewriteCond %{IS_SUBREQ} ^false$ RewriteCond %{LA-U:REMOTE_USER} (.+) RewriteRule . - [E=RU:%1] RequestHeader set REMOTE_USER %{RU}e
</Location>
<snip>
HTTP_REMOTE_USER '(null)'
One voodoo solution that worked for me (not with NTLM, but exactly with the same '(null)' symptom) is to take the entire "RewriteCond" part outside of the <Location> block. Put it in the global configuration file, after the <Location> part, but before the proxy statement. Also, the exact incantation that worked for me (after many many trials and errors) is: === RewriteRule . - [E=RU:%{LA-U:REMOTE_USER}] RequestHeader set REMOTE_USER %{RU}e === It's voodoo (to me) because it probably has something to do with deep apache internals, relating to execution order of the authentication module vs the "mod_rewrite" parts (and the "LA-U" [Look-ahead] thing sure doesn't help to make it clearer...). -gordon ======================================================================= Attention: The information contained in this message and/or attachments from AgResearch Limited is intended only for the persons or entities to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipients is prohibited by AgResearch Limited. If you have received this message in error, please notify the sender immediately. =======================================================================