KB0074 - Connecting to PSU API w/Windows Auth

KB0074 - Connecting to PSU API w/Windows Auth

Scope

This article applies only to PSU environments where Windows Authentication[1] is enabled and known to be working[2].

Problem

You are not able to interact with the PSU instance using the Invoke-WebRequest PowerShell cmdlet even though logging in from a web browser works as expected.


(figure shows a failed attempt at signing in to a PSU node via Invoke-WebRequest)

Root Cause

Windows authentication on supported PSU nodes uses Kerberos authentication which cannot accept a standard authentication body.

Solution

Add either the -UseDefaultCredentials parameter or -Credential with a variable to Invoke-WebRequest.


(figure shows a successful attempt at signing in to a PSU node via Invoke-WebRequest)

You do not need to access the signin endpoint when using Windows Authentication

Reference

    • Related Articles

    • KB0066 - Get-WMIObject cmdlet not working

      Scope This article applies to any scenario where the Get-WMIObject cmdlet is expected to be available and functioning within a PowerShell Universal instance. Effectively, this article will only apply to instances that run under the Windows operating ...
    • KB0017 - Windows Auth Checklist

      Purpose The purpose of this article is to list the prerequisite conditions for ensuring that Windows Authentication in PowerShell Universal will function as expected (i.e. seamless logon without authentication pop-ups) Scope The scope of this article ...
    • Variables created within modules are not available in Universal API endpoints

      Version: 1.4+ When using environments that import modules, you will not be able to access variables that are either global or export from modules.  Affected Configuration The affected configuration includes modules that export variables either with ...
    • KB0011 - Are licenses different between Production, QA and Test/Development servers?

      Update January 24th, 2023 Adam recently summarized the Developer's license per below: The only real limitation on the developer license is that it cannot be accessed remotely. The server is only available on loopback when using the dev license. If ...
    • PowerShell Universal Service crashes on startup after an upgrade to 1.4.6

      Version: PowerShell Universal 1.4.6 Issue The PowerShell Universal service will crash with the following error in Event Viewer.  Application: Universal.Server.exe CoreCLR Version: 4.700.19.56402 .NET Core Version: 3.1.0 Description: The process was ...