--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To post to this group, send email to trac-...@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Hi Ryan,
thanks again for the quick reply.
I think, the 'proxy_pass_header Authorization' directive is only necessary,
when trac should handle authentication. Cf. https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side
In my setting, I want nginx to handle (not pass) this authorization header.
Just to be sure, I tried with 'proxy_pass_header Authorization' as well, but this does not change anything.
Is there some place, where I can patch the ''environ['REMOTE_USER'] = environ['HTTP_REMOTE_USER']" line?
I'm new to python, so any directions would speed up my attempts.
I'm happy to help setting up some useful description for Trac with nginx, once this works out.
Not that I'm an nginx expert. Using it for a couple of month now...
Kind regards,
Alex
def authenticate(self, req): if self.obey_remote_user_header and req.get_header('Remote-User'):
remote_user = req.get_header('Remote-User')
req.environ['REMOTE_USER'] = remote_user
return remote_user return None
Hi Ryan,
the patch works!
I can now authenticate in nginx and trac detects the authenticated user as expected.
Unfortunately, I still have some issues:
First, for some reason, the browser receives a location header like this:
Location: http://trac.mydomain.com:8080
The public page should rather be https://trac.mydomain.com/
After logging in, I can go back to the correct page and browse the page fine.
The redirect only happens on '/login' and '/logout'.
Second, I want to make use of LDAP groups, i.e., assign trac-admin rights
to members of a special group. Is there a way to pass this information from
nginx to trac? E.g. a REMOTE_GROUP(S) header?
On Monday, January 25, 2016 at 8:40:22 AM UTC-8, deadf00d wrote:Hi Ryan,
the patch works!
I can now authenticate in nginx and trac detects the authenticated user as expected.I thought about it some more last evening and I'm rather surprised that it works for you. Presumably the `perm` callback needs to be invoked to set req.environ['REMOTE_USER']. I don't see where the callback is invoked in either trac.web.main.dispatch_request or when the request is matched and processed in trac.web.auth:I also don't see how the recipe discussed in #9206 can work, unless the Trac instance is not available to anonymous users. If none of the Trac paths can be accessed by anonymous users and the user is forced to authenticate through the web server first for any path, then login/logout buttons would be non-functional.