-
Notifications
You must be signed in to change notification settings - Fork 1
Description
The New-SumoCredential cmdlet is failing with HTTP 401: Full authentication is required to access this resource.
The reason for this appears to be that Sumo Logic's API responds with a 301 redirect to the correct API endpoint for the service region based on the credentials provided, if the inital request uses the region-agnostic API endpoint https://api.sumologic.com/api/v1/. When PowerShell processes the redirect request, it does not pass the credentials through, which causes the server to respond with 401.
The solution probably is either to add logic detecting a 301 response code to the initial request and to update the $SumoBaseAPI variable accordingly, or to use a WebSession object to track cookies, which should result in a successful redirect.