1

I am trying to query issues using the JIRA REST API, and with my desired JQL query, I was getting no results. By looking at the headers with the -v option to curl, it transpired that when I pass the -n option, it would never send the Authentication header. This is because this JIRA instance allows anonymous access, so it never issues the basic authentication challenge response which would prompt curl to send the username and password I specified in my .netrc file. Unfortunately, anonymous users cannot see the issues I wish to query, so I need to force authentication.

Using the -u option to curl to specify my JIRA username and password on the command line works, but I do not wish to do this in general, because that would mean that my password would be visible on my screen, in my bash history, etc.

I have tried adding other options to the command line, but they don't help.

1 Answer 1

2

Put the -u option in a text file, verbatim. You can then use the --config option to curl to append that option to the command-line. This is more secure that using a script to do so, because the script would still leave the password visible in the process list, at least on Linux and Unix.

Just like with the .netrc file, make sure the config file is not readable by other users!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.