Creation of API Tokens for Technical Users
Last modified by DevOps-as-a-Service Operator on 2025/02/05 11:33
Introduction
If you create a Technical User for Jenkins in the DevOps Portal, the credentials can only be used to log in to the Jenkins UI. To interact with the Jenkins REST API (Basic HTTP Authentication with a username and password) you have to manually create an API Token for your Jenkins tech user first.
How to Create an API Token in Jenkins
- If not done yet, set up a Technical User in the DevOps Portal for Jenkins and assign it to the intended projects. Don't forget to record the password.
- Log in to Jenkins with the credentials of the Technical User. Since you need a different browser session for that, it's recommended to open an anonymous window in your browser for that.
- At the top of the page, click on the username ➡ Configure
- On the Configure page, in the section API Token, click on "ADD NEW TOKEN".
- Copy and record the created token for the intended use, then click SAVE.
- Log out
- Now Basic HTTP Authentication can be used with the username and the generated API Token (see https://www.jenkins.io/doc/book/system-administration/authenticating-scripted-clients/)