Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55624

Authorize Projects plugin causes no git credentials to be found with 'Run as Specific User' Strategy is set

XMLWordPrintable

      When attempting to configure source control for a freestyle job with the Build Authorization Strategy set to 'Run as Specific User', I don't see any available git credentials.

      I have credentials installed and they appear when I set Build Authorization Strategy to "Run as User who Triggered Build". See attached images.

      However, if I set the Build Authorization Strategy to "Run as User who Triggered", configure my job with the proper credentials and then switch to "Run as specific user", everything works, but when I go to configure the job the git credentials section of the config page displays the error that the currently configured credentials cannot be found.  This is an ugly workaround but it does let my job run as desired.

      Steps to Reproduce:

      • Install Authorize Project
      • Configure Global Security > Access Control for Builds and to allow Per-project configurable build authorization with the "Run as Specific User" and "Run as User who Triggered Build" strategies. 
      • Add another user to the local Jenkins user database.
      • Create a new freestyle project. 
      • Enable git source control and add some credentials and select those.  Save the project.
      • Enable "Configure Build Authorization" and set the strategy to "Run as Specific User". Set this to the new user you added (in my case this was not the same as my currently logged in user but testing showed that it didn't make a difference what user I entered)
      • Go back to the Configure page for the job.  Observe that no credentials can be found according to the error on the Git SCM section of the page and no credentials appear in the drop down menu.
      • Switch the projects authorization strategy to "Run as user who Triggered Build"
      • Go back to the Configuration page for the job. Observe that the credentials appear valid and all available credentials appear.

            mikenicholson Mike Nicholson
            mikenicholson Mike Nicholson
            Votes:
            5 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: