0

I am trying to call PingAccess APIs to configure my PingAccess. I am new to using APIs to do this, and have a question.

I am trying to use CURL to the API .

curl -k -u Administrator:dummypsswd -H "X-Xsrf-Header: PingAccess" -H "Content-Type: application/json" -d '{"alias":"PLACEHOLDER_STAR_MINGLE","fileData": [[System.IO.File]::ReadAllBytes("C:\test.pfx")],"password": "1234"}' https://localhost:9000/pa-admin-api/v1/keyPairs/import -v

When I run this I get the following error.

Error On Powershell

I still dont know why am I unauthorized. Any help is appreciated.

Rahul
  • 1,549
  • 3
  • 17
  • 35

1 Answers1

3

When you have special characters in your password you'll need to enclose the username/password tuple in double quotes:

curl -k -u "Administrator:dummypsswdwithspecialcharslike&&" -H "X-Xsrf-Header: PingAccess" -H "Content-Type: application/json" -d '{"alias":"PLACEHOLDER_STAR_MINGLE","fileData": [[System.IO.File]::ReadAllBytes("C:\test.pfx")],"password": "1234"}' https://localhost:9000/pa-admin-api/v1/keyPairs/import -v
Hans Z.
  • 50,496
  • 12
  • 102
  • 115