Hi All,
Looking forward to getting my first gitit server up and running. I think I'm quite close, but am having trouble getting authentication / login to work.
I have configured the server to be behind a reverse proxy using apache, as described in the instructions. It's at the (example, domain name changed!) address
https://my.server:12345/gitit/ .
I am now able to see the default front page at that address.
I would now like to use information from the client certificate (which my server demands, so the information is always available) to set the login credentials for the wiki. I have set the requirement for login to be “modify” so that editing pages requires a login. If I set require-authentication to “none”, I am able to edit the page anonymously. Note that even with this “none” setting, I do not see a login button on the front page … might this be related to
http://code.google.com/p/gitit/issues/detail?id=73 ? Even accessing the wiki locally rather than via the reverse proxy does not display a login button.
Accordingly, I have been playing with the authentication-method setting in the gitit config. So far, both ways I've tried have failed:
First way, “generic”:
Within the gitit config, I set the authentication-method to be generic.
This indicates that the REMOTE_USER environment variable should be used as the login name.
Within the “<Location /blah/>” element of my apache config, I add the following line:
SSLUserName SSL_CLIENT_S_DN_CN
This /may/ set the environment variable REMOTE_USER, but I'm not completely clear about that. I have therefore also tried using a SetEnv to set that variable directly, but the result is the same.
This leads to the following error when I click the link from the default front page to edit it (The URI is
https://my.server:12345/gitit/_login?destination=%2F_edit%2FFront%2520Page ):
“
Happstack 6.6.3
Your file is not found
To try again is useless
It is just not here”
Second way:
Within the gitit config, I set the authentication-method to be http. This indicates that the “Authorization” header should be used to provide the login name.
Within the “<Location /blah/>” element of my apache confic, I add the following line:
RequestHeader set Authorization "%{SSL_CLIENT_S_DN_CN}s"
When I click on the link in the line “There is no page 'Front Page'. You may create the page by clicking here.” though, I get into an infinite redirect loop: According to firebug the browser bounces with a 303 and a 307 between
https://my.server:12345/gitit/_login?destination=%2F_edit%2FFront%2520Pageand
https://my.server:12345/gitit/_edit/Front%20Page… each redirects to the other.
So, in short, what am I doing wrong? I'm not sure whether this is a problem in my apache config, gitit config, or gitit itself!
My hope is that once gitit can genuinely see the user name in some way universally, the login redirect will /work transparently/ and I'll be automagically logged in and taken to the edit page. It feels as if the second way is closer, since the _login function is forwarding me to the _edit function, suggesting that _login thinks I /am/ authenticated … but then _edit is bouncing me back to _login because _edit thinks I'm /not/ authenticated!
I'm using apache2.2.22-1ubuntu1 and gitit 0.9-1ubuntu1 of ubuntu 12.04.4.
Any help would be very welcome, it feels so close! Any working recipes also fine, I can dig through to match the necessary bits to my config.