How to (re)generate my Jenkins user token

Issue

  • How we can get the user APIToken?
  • How we can change the user APIToken?

Environment

Resolution

An API Token is a Jenkins generated code that allow you to use se HTTP BASIC authentication in order to make operations using CLI or REST calls to the Jenkins API.

  • Go to your Jenkins instance and login with the user that you want to generate the APIToken for

  • Then open the user profile page

  • Click on Configure to open the user configuration page

  • In order to show the current APIToken click on Show API Token button

  • To generate a new APIToken click on Change API Tokenbutton

Have more questions? Submit a request

3 Comments

  • 0
    Avatar
    Discover Bank

    Is there a way to programmatically generate/rotate the same?

     

    Thank you

  • 0
    Avatar
    Andrey Kaliazin

    More generally - how to access/modify the user security parameters - API token, SSH private key etc, via ssh, jenkins cli, rest? 

    Just showing how to do it via GUI is not helpful really.

    Kind regards

  • 0
    Avatar
    Samrat Shaw

    I have written an article of how we an retrieve the token programmatically. 

    Might be helpful to other.

    https://medium.com/@samratshaw/programmatically-retrieve-jenkins-rest-api-token-f2c3f0d69483

Please sign in to leave a comment.