Skip to content

Update user.adoc - Example of adding a 'secret text' credential and correction of a misspelling. #561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion docs/user.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ domain/testing/api/json?tree=credentials[id]
----
<1> Whitespace has been added to the response to make a more readable example

===== Creating a credentials
===== Creating credentials

The URL for creating a domain is: `http://_jenkins root url_/_path to context_/credentials/store/_store id_/domain/_domain name_/createCredentials`.
This URL expects a `POST` request with a `Content-Type` header of type `application/xml`.
Expand Down Expand Up @@ -941,6 +941,22 @@ https://jenkins.example.com/job/example-folder/credentials/store/folder/\
domain/testing/createCredentials
----

.Example of adding a `secret text` credential.
[source,bash]
----
$ cat > credential.xml <<EOF
<org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl>
<scope>GLOBAL</scope>
<id>wecoyote</id>
<secret>secret123</secret>
<description>TEST</description>
</org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl>
EOF
$ curl -X POST -H content-type:application/xml -d @credential.xml \
https://jenkins.example.com/job/example-folder/credentials/store/folder/\
domain/testing/createCredentials
----

[TIP]
====
The secret is passed _in the clear_ so that Jenkins can then encrypt it before storing to disk.
Expand Down