1

I was trying to download a file from an URL which required users login with SingleSignOn (SSO). The URL is a website using SAML authentication method. Is there anyway I can do in the script to authenticate the users or anything else I could do? The following method does not help as it prompt user for username and password but still did not get to the SSO, hence, it is still returning error "unathourized 401":

$credential = Get-Credential
$Url = 'xxxx'
$Dest = 'xxxx'
Invoke-WebRequest -Uri $Url -OutFile $Dest -Credential $credential

error:

"The remote server returned an error: (401) Unauthorized."
abunehneh
  • 100
  • 1
  • 5
  • So what happens if you just leave the `-Credential $credential` out? – iRon Aug 19 '22 at 15:39
  • @iRon it doenst work as well, it will still prompt user to key in username and password. But that will not work since I believe it's caused by the SAML SSO – abunehneh Aug 19 '22 at 16:00

0 Answers0