Webdev Tory
Webdev Tory

Reputation: 515

Change Jenkins URL (github auth)

We had Jenkins configured on a remote server using github credentials at jenkins.A.com . The URLs were changed before Jenkins was updated so the server is now accessed at jenkins.B.com, and now after we visit and try github credentials, I am bounced back to http://jenkins.A.com/securityRealm/finishLogin?code=ZYX&state=XYZ -- in otherwords, somewhere jenkins.A.com is saved and that's what I need to change to jenkins.B.com . Is there a config file or some other headless way I can do this, given that I cannot log in to Jenkins via browser?

Upvotes: 2

Views: 367

Answers (2)

Webdev Tory
Webdev Tory

Reputation: 515

The fix was not in Jenkins, but in Github. My problem was actually that the callback address on my github oath application. The answer was to edit the application and make sure the callback address was the new address, as per https://docs.github.com/en/developers/apps/managing-oauth-apps

With this corrected I just needed to make sure my Apache config was correct and then everything worked.

Upvotes: 3

VonC
VonC

Reputation: 1328152

You could try and set the global Git configuration (global to the same account Jenkins is running) with insteadOf:

git config --global url."http://jenkins.B.com".insteadOf http://jenkins.A.com

That way, Git would consider B only, wherever A is still used.

Upvotes: 0

Related Questions