pull-request-notifier-for-bitbucket
pull-request-notifier-for-bitbucket copied to clipboard
Use Jenkins User API Token for Authentication
Between this plugin and the "Parameterized Builds for Jenkins" I can't quite accomplish what I want to do. I want to:
- Trigger a Jenkins task on a PR Merge
- Filter on the PULL_REQUEST_TO_BRANCH
- Authenticate using the users jenkins API Token
Your plugin, from what I can tell, can only do 1 and 2. The only Jenkins auth I can configure is a per-trigger basic auth (single user). I would like to be able to authenticate using the person that is merging the PR. I work in an environment where we cannot have a Jenkins user account with basic auth (no one knows the password for service accounts)
(Only providing this for example purpose) The "Parameterized Builds for Jenkins" plugin provides the capability to add your Jenkins API Token in your Account Settings and uses that to do the trigger auth.
Is there any chance this can be added as a new feature?
DId you try invoking the plugin like this?
http://<username>:<api-token>@<jenkins-server>...
See: https://stackoverflow.com/questions/10698419/how-can-a-jenkins-user-authentication-details-be-passed-to-a-script-which-uses
I think that's the same as putting my username and api-token in the Basic Auth field (witch does work). But I still need a way to get the API Token of the currently logged in user.
This may be a silly question because of my limited knowledge of how Bitbucket plugins work, but is there a way for me to get the API token as an environment variable from my account settings. I realize this is also part of another plugin.
You may want to use the variables resolving to the current user in Bitbucket. And on the Jenkins side simply trust that information. Without actually athhenticate. Other than that i dont think i have any suggestions.
Den 20 juli 2017 22:27 skrev "belldevelopers" [email protected]:
I think that's the same as putting my username and api-token in the Basic Auth field (witch does work). But I still need a way to get the API Token of the currently logged in user.
This may be a silly question because of my limited knowledge of how Bitbucket plugins work, but is there a way for me to get the API token as an environment variable from my account settings. I realize this is also part of another plugin.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/235#issuecomment-316820199, or mute the thread https://github.com/notifications/unsubscribe-auth/AAa1E0ATazwUQ-8FGXSQMsCzBnGKqc7Yks5sP7gmgaJpZM4OemYY .