How can I set the jenkins authentication token?

我与影子孤独终老i 提交于 2020-12-28 18:23:32

问题


On my Jenkins build server, I want to set an Authentication Token so that only users that know the token can fire off builds. (As described here.)

This doc page says that it should be configurable under my job's "Build Triggers" configuration.

However, my server has no such fields, and I'm running the latest version (1.546). Mine looks like this:

this.

As you can see, this doesn't really look like the docs say it should.

How can I set this token?


回答1:


You're missing the Trigger builds remotely (e.g., from scripts) Build Trigger:

Trigger builds remotely

This is only visible with Security enabled. To get this option from a freshly downloaded 1.546 WAR, I changed Configure Global Security from Anyone can do anything to at least Logged-in users can do anything. For ease/speed of testing, under Security Realm I selected Jenkins’ own user database and Allow users to sign up:

enter image description here




回答2:


You can go to http://Jenkins-IP/jobs/me/configure to check and change your API access token. Also check whether the user you intend to use has necessary permissions to execute the builds in Manage Jenkins>Configure Global Security




回答3:


Each jenkins user gets an authentication token - applicable since version 1.426 (more).

You can see yours, provided you are logged in your jenkins server, at http://your.jenkins.server/me/configure (press 'show API token' button)

Then you can copy and paste it in your scripts (e.g. see here for an example usage).



来源:https://stackoverflow.com/questions/21032349/how-can-i-set-the-jenkins-authentication-token

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!