0

I am new to CURL and facing problems while writing a script to get a response from HTTPS URL.

Its failing at singleSignOn.

Basic command I am using is:

curl -UseBasicParsing https://abc.xyz.com.au -UseDefaultCredentials

Can someone please help with pointers how to force SSO on CURL while doing a check on HTTPS URL?

Mehravish Temkar
  • 4,275
  • 3
  • 25
  • 44
shilpa jain
  • 1
  • 1
  • 1

1 Answers1

0

In Powershell Curl is really an alias for Invoke-WebRequest.

If you're new to this commandlet, start easy. Try using it with Google:

Invoke-WebRequest -Uri 'https://www.google.com'

Authentication is a little tricker. If the site uses basic authentication, you can use something like the following:

$credential= Get-Credential
Invoke-WebRequest -Uri 'https://foo.com' -Credential $credential

Depending on the application, you might have to construct the basic authentication headers yourself. There is a nice explanation of that in the post Use Invoke-WebRequest with a username and password for basic authentication on the GitHub API

If the single-sign-on piece is using redirection, that's a different animal. You can use the Headers property on the response object to find the URL you're being redirected to. Jim McNatt has a nice article talking about that.

Adam
  • 3,891
  • 3
  • 19
  • 42