Upgrade to 2.5 Issue - AAD login disappears

Product: PowerShell Universal
Version: 2.5

I installed the 2.5 nightly build to test the PNP issue, but it seems to have broken the AAD authentication. It now will only take me to the login screen, instead of doing SSO auth with AAD. I still see my settings in appsettings.json.

I noticed this as well. It seems to happen when forms authentication is enabled along side AAD or Windows auth. You can disable forms auth in authentication.ps1 to work around it otherwise I will have to get a fix in for it today.

How do I disable Forms? When I try to do it in the GUI, it doesn’t seem to work.

Settings \ Configurations \ authentication.ps1

Add the disabled onto the Set-PSUAuthenticationMethod call.

Set-PSUAuthenticationMethod -Type "Form" -ScriptBlock {
param(
    [PSCredential]$Credential
)
#
#   You can call whatever cmdlets you like to conduct authentication here.
#   Just make sure to return the $Result with the Success property set to $true
#
if ($Credential.UserName -eq 'Admin') 
{
    New-PSUAuthenticationResult -Success -UserName 'Admin'
}
else 
{
    New-PSUAuthenticationResult -ErrorMessage 'Bad username or password'
}
} -Disabled 

I was wrong about this. The AAD appsettings.json settings aren’t working in the nightly. I will get a fix in for them today. The above workaround only works for windows auth.

1 Like