Question

I'm currently using Jenkins, and I wanted to authorize the Github access by using the OAuth plugin. So, I added the needed "Client ID" and "Client Secret" via Github's page to Jenkins to ensure that Jenkins and Github were talking to each other.

After this the Jenkins and Github handshake (via Oauth I believe) got stuck in some kind of infinite loop, so I decided to remove the OAuth application access via Github. Still, after I've done this, if I try to access localhost:8080 via Google Chrome, Chrome redirects me to https://github.com/login/oauth/authorize?client_id=<client_id_here> page (with a proper client id added). What can I do to remove this redirect? Ideally I'd like localhost:8080 to take me to the Jenkins dashboard as it used to... :(

Was it helpful?

Solution

It looks like this may let you fix your problem:

One may accidentally set up security realm / authorization in such a way that you may no longer able to reconfigure Jenkins.

When this happens, you can fix this by the following steps:

  1. Stop Jenkins (the easiest way to do this is to kill the servlet container.)
  2. Go to $JENKINS_HOME in the file system and find config.xml file.
  3. Open this file in the editor.
  4. Look for the <useSecurity>true</useSecurity> element in this file.
  5. Replace true with false
  6. Remove the elements authorizationStrategy and securityRealm
  7. Start Jenkins

When Jenkins comes back, it's in the unsecured mode where everyone gets full access to the system.

If this is still not working, trying renaming or deleting config.xml.

Once you get in, uninstall or reconfigure the GitHub OAuth plugin using the Jenkins UI, re-enable security, and try again!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top