Problem setting up Azure AD login


#1

Hi,

I’m trying to setup Azure AD login and have created the below sample based on //adamdriscoll.gitbooks.io/powershell-universal-dashboard/content/security/authentication/azuread.html:

$AuthenticationMethod = New-UDAuthenticationMethod -Provider AzureActiveDirectory -ClientId ‘My Azure App ID’ -Instance ‘https://login.microsoftonline.com//oauth2/authorize’ -Domain .onmicrosoft.com -TenantId ‘’
$LoginPage = New-UDLoginPage -AuthenticationMethod $AuthenticationMethod -Title “AzureAD”

$Page1 = New-UDPage -Name “Page1” -Icon calendar -Content {
New-UDCard -Title “Hello, Universal Dashboard”
New-UDTextbox -Value “test”
}
Start-UDDashboard -Port 1000 -AllowHttpForLogin -Dashboard (
New-UDDashboard -Title “Dashboard” -Pages @($Page1) -LoginPage $LoginPage
)

When starting it up I get “SIGN IN WITH AZURE ACTIVE DIRECTORY”, but when i select this option I’m redirected to “localhost:1000/signin” and get an HTTP 500 error.

What am I doing wrong?

/Jens


#2

You aren’t specifying a TenantID.

Also you don’t quite have all the right parameters. Here is my AzureAD authentication, currently working fine. v 2.1.0

# Authentication
$AzureADParams = @{
    ClientID = MY_CLIENT_ID
    Instance = 'https://login.microsoftonline.com'
    Domain   = 'MY.FQDN.COM'
    TenantID = MY_TENANT_ID
}

$AuthenticationMethod = New-UDAuthenticationMethod @AzureADParams

It looks like you’re looking at some old documentation. Current AzureAD auth documentation is here:

https://adamdriscoll.gitbooks.io/powershell-universal-dashboard/security/authentication/azuread.html


#3

Great,your example helped me and I have it all working.