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

REST API to create credentials showing 404 error

       

       The following command is causing a 404 error:

       

      curl -v -u admin:admin -XPOST  http://localhost:8080/credentials/store/system/domain/_/createCredentials -F 'json={"": "4", "credentials":{"secret": "my secret val", "id": "mysecretid", "stapler-class": "org.jenkinsci.plugins.plaincredentials.impl.StringCredetialsImpl", "$class": "org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl"}}'

       

          [JENKINS-49373] REST API to create credentials showing 404 error

          Oleg Nenashev added a comment -

          Please provide a full stacktrace of the error from the System log

          Oleg Nenashev added a comment - Please provide a full stacktrace of the error from the System log

          Daniel Beck added a comment -

          Works for me (when specifying the CSRF crumb) on a 2.89.3 jenkinsci/blueocean image with no other configuration changed. Please provide steps to reproduce the problem from scratch.

          Daniel Beck added a comment - Works for me (when specifying the CSRF crumb) on a 2.89.3 jenkinsci/blueocean image with no other configuration changed. Please provide steps to reproduce the problem from scratch.

          Daniel Beck added a comment -

          Also works on the latest jenkins/jenkins weekly image (2.105) with Plain Credentials 1.4 installed.Also needs a crumb unless I use the API token (improvement in 2.96).

          Daniel Beck added a comment - Also works on the latest jenkins/jenkins weekly image (2.105) with Plain Credentials 1.4 installed.Also needs a crumb unless I use the API token (improvement in 2.96).

          Daniel Beck added a comment -

          Not to mention that this is unlikely to be supported API, you're just impersonating a web browser's form submission. I'd be surprised if we supported json arguments in a real API.

          Daniel Beck added a comment - Not to mention that this is unlikely to be supported API, you're just impersonating a web browser's form submission. I'd be surprised if we supported json arguments in a real API.

          Martin F added a comment -

          danielbeck Is there no official API to add credentials?

          Martin F added a comment - danielbeck Is there no official API to add credentials?

            stephenconnolly Stephen Connolly
            pontusvision Leo Martins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: