I think my server is configured properly - I've checked it at least a dozen times, though I will double check anything requested. The only clue I have is that I can access the statistics API through a browser call, but only on my second consecutive attempt.
Full version info, for those interested: v1.8.0-SNAPSHOT b28700112 r28ded00d08aa0deb05885294681497b1adb0ae81. I've attempted to install the latest and greatest, in case I was running up against a known bug.
If tried every random suggestion I could find with my very best GoogleFu but here is the basis of my code, and what I initially expected to work:
[string]$BaseUri = "http://MyUrl:8080/pwm/public/rest/statistics"
[string]$ContentType = "application/json"
$session=new-object microsoft.powershell.commands.webrequestsession
$Headers = @{'Accept' = 'application/json'; 'Accept-Language' = 'en'; 'Authorization' = 'Basic MyAuthDetails'}
$JSONResponse = Invoke-WebRequest -URI $BaseURI -Headers $Headers -ContentType $ContentType -Method Get -websession $session
Any pointers are greatly appreciated.
"error while processing PwmValueTag: 5015 ERROR_UNKNOWN (attempt to read PwmSession from HttpSession failed)"
Obviously this is what pushed me to look into authentication options to fix my issues. I simply don't know enough about the technique to get there by myself.
I'm getting further, which is nice, but I'm still not getting back data - just:
{"error": true,
"errorCode": 7000,
"errorMessage": "Error_RestInvocationError"}
I am using the 'External Web Service Secrets' as you suggested, which I granted every possible permission. I have logging turned way up, but this is all I'm getting:
rest request authentication status: {\"type":"NAMED_SECRET\",\"namedSecretName\":"\MySuperSecretUsername\","usages\":[\"RandomPassword\","\Profile\",\"VerifyResponses\",\"Status\",\"SetPassword\",\"SigningForm\",\"Challenges\",\"CheckPassword\",\"Statistics\",\"VerifyOtp\",\"Health\"],\"thirdPartyEnabled\".true}
And then:
completed rest invocation in 11ms success=false
I have no idea what I'm doing wrong and can't turn the log info into anything helpful. Is what I'm trying to do just not possible?