Skip to content

Credentials cannot be retrieved when authorize-project plugin is enabled #247

@darxriggs

Description

@darxriggs

When using the authorize-project plugin to run jobs with a specific user, then credentials are not retrieved correctly, only anonymous: is used for basic auth.

How to reproduce

  1. Create a global "Username with password" credential with id example-id.
  2. Setup a pipeline with a Jenkinsfile as follows.
node {
  artifactoryDownload(
    server: Artifactory.newServer(url: 'http://...', credentialsId: 'example-id'),
    spec: '{ "files": [{"pattern": "example" }] }',
  )
}
  1. Under "Manage Jenkins / Configure Global Security" enable security.
  2. Configure a user that is granted all permissions.
  3. Under "Manage Jenkins / Configure Global Security / Access Control for Builds" configure "Project default Build Authorization" to use this user.
  4. Perform a build.

On the server side the Authorization header contains Basic YW5vbnltb3VzOg== which decodes to anonymous:.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions