Jenkins blue ocean change github access token
Asked Answered
E

5

15

Jenkins blue ocean pretty cool continuous integration tool, but I faced the following problem:

At the main page, as was asked, I inserted my GitHub access token

jenkins generate access token

And after that I realized that was incorrect token from another company.
And now I want to change to another token but there is no option to do that. I'm always getting the following screen without the possibility to change the key.

no way to change github access token

I found out that if I the token was deleted from GiHub tokens page I can insert the new one at the page depicted above. But now there is no way to delete that token. I need to resolve the problem from Jenkins UI.

Any Ideas how to change?

Expectorant answered 19/7, 2017 at 10:2 Comment(0)
D
27

Steps to delete the Access-Token:

  1. Go to the 'old' interface (i.e. not Blue Ocean)
  2. Click on your username in the top right
  3. Click on Credentials on the left
  • You should see an entry with the domain blueocean-github-domain the id github and the name <username>/****** (Github Access Token).

Delete it.

Afterward, BlueOcean will ask for an Access Token again, when using "Github" as the source.

Dissoluble answered 19/7, 2017 at 12:7 Comment(4)
thanks. What do you think, is there a way to create another pipeline with another token? but do not delete the previous one.Expectorant
Have the same issue but I don't see anything close to "blueocean" on the list of credentials and I don't want to delete the wrong one...Glucinum
I can see blueocean but not delete button. You can see blueocean if you go to project and then click credentials. If you click credentials on jenkins root, then you cant see blueocean.Bohol
I guess I need to do this when no one is relying on the server, and there will be a period when it is not working? Or does it create a new one before it deletes it?Push
B
0

I tried many things, at the moment best solution is to delete project and create new blueocean project with new credentials.

Bohol answered 30/7, 2018 at 8:52 Comment(0)
A
0

Add a new credential in Jenkins and choose "Username and Password" as the type. The username should be your GitHub username and the password is the API token. Make sure the credential is added to a store that the project has access to.

Anabelle answered 13/8, 2019 at 20:53 Comment(0)
R
0

tkausl's instructions didn't work for me because there was no "Delete" or "Modify" button. So here is my extended solution (it needs shell access).

With shell access, you can find the file where your token is stored (in my case it was ./users//config.xml). However, you cannot just edit that file, because the token is stored in encrypted form (and base64-encoded). So instead, create a new dummy credential with the correct token. The dummy credential gets added (in encrypted form) in the file ./credentials.xml. Open that file and copy the password (in base64 and encrypted form) into where the actual credentials are (./users//config.xml). Finally, go to "Manage Jenkins" > "Reload Configuration from Disk".

Rambler answered 29/9, 2021 at 16:48 Comment(0)
R
0

I think @bhow has something similar but just to make it clear - you don't need to delete the project or the existing token.

You can go to Blue Ocean, choose the project and then choose the gear icon to change the project settings.

Under "Branch Sources" you'll see the current Github credentials. From there you can choose to add new credentials. In my case I added a new "Username with password" where the username was my username, and password was my Github token. By choosing this new option from the credentials dropdown I could see that the authenticated user changed.

Rhoden answered 30/11, 2021 at 15:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.