| Finally, let's get back to Basic Auth in the nginx reverse proxy in front of Jenkins. When I have cleared the Basic Auth as described and everything is working, and I then enable Basic Auth in nginx, I get a password prompt (into which I put my nginx-configured credentials, let's say username niklas), and everything continues working fine (I'm still logged in in Jenkins and can browse around). But as soon as I click Logout in Jenkins, everything breaks, and I cannot get logged back in with Github. That is because we now have the same problem as before: The plugin picks up nginx's Basic Auth and uses that user to Github:
org.acegisecurity.providers.UsernamePasswordAuthenticationToken@dc12364c: Username: niklas; Password: [PROTECTED]
Which is wrong, because it should use the normal OAuth and ignore nginx's Basic Auth. That means right now, you can't run Jenkins behind nginx with Basic Auth while also using the github-oauth-plugin. So it seems there should be a way to disable the second branch in
if (authentication instanceof GithubAuthenticationToken)
return authentication;
if (authentication instanceof UsernamePasswordAuthenticationToken)
try {
being taken, and forcing Github auth no matter the HTTP auth. |