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

REST API to create credentials showing 404 error

    Details

    • Similar Issues:

      Description

       

       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"}}'

       

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

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

          Show
          oleg_nenashev Oleg Nenashev added a comment - Please provide a full stacktrace of the error from the System log
          Hide
          danielbeck 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.

          Show
          danielbeck 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.
          Hide
          danielbeck 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).

          Show
          danielbeck 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).
          Hide
          danielbeck 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.

          Show
          danielbeck 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.
          Hide
          gabel Martin F added a comment -

          Daniel Beck Is there no official API to add credentials?

          Show
          gabel Martin F added a comment - Daniel Beck Is there no official API to add credentials?

            People

            • Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              pontusvision Leo Martins
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: