Skip to content

Need to Detect Correct Service Region in New-SumoCredential #9

@pjorg

Description

@pjorg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions