1

I know that you can give cURL a user/pass combination using the -u flag which is great. What I'm trying to do is get the credentials from a file on the filesystem and pass that in. For example

in auth.conf

id=q8374grf748
key=47w34kurgfuegurfgser7348gfeurfgyu

then I'd like to do the equivalent:

curl -u id:key http://example.com
Sabuj Hassan
  • 38,281
  • 14
  • 75
  • 85
Spanky
  • 5,608
  • 10
  • 39
  • 45
  • Ok so you already have a plan. The next step would be to execute the plan. Good luck with that! – PeeHaa Feb 21 '14 at 20:14
  • @Spanky its a very good question. I don't know why people flagged your question to close it down. You have asked a valid question from the perspective of `curl-commandline`. I am also interested to know the answer of this question. – Sabuj Hassan Feb 22 '14 at 01:51

1 Answers1

1

You can Try this out :-

curl --user user:pass https://whatever.com/login

Even if you need to save cookie and try to access another page in site try this

first

curl --user user:pass --cookie-jar ./cookiefile https://whatever.com/login

Second

curl --cookie ./cookiefile https://whatever.com/secondpage
KWick
  • 167
  • 2
  • 10