ADFS SSO Issues

Hello,

I am creating a PowerShell script that will access a web application (https://i2productionserver.ourdomain.com). It uses SSO and I had a method working two weeks ago, where I use:

$url = "https://i2productionserver.ourdomain.com/platform" $x = Invoke-WebRequest -Uri $url -SessionVariable Testing -UseDefaultCredentials -UseBasicParsing $postParams = @{ 'wa'="$($x.InputFields.FindByName('wa').value)"; 'wresult'="$($x.InputFields.FindByName('wresult').value)"; 'wctx'="$($x.InputFields.FindByName('wctx').value)"; } | ConvertTo-Json $y = Invoke-WebRequest -Uri "https://i2productionserver.ourdomain.com/" -Method Patch -Body $postParams -WebSession $Testing $z = Invoke-WebRequest -Uri $url -WebSession $Testing 

This would get the token from ADFS and using the Action URL and post the data. However, today I am getting an error back from $y:

Invoke-WebRequest : Server Error 405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access. 

Anyone have any idea’s on why this is happening or a way to get authenticated and access the server.

EDIT: Even though I am trying to access i2production server, I land here to be authenticated with AD: https://adfs.mycompany.com/adfs/ls/auth/integrated/

submitted by /u/Keitaro27
[link] [comments]

Leave a Reply