Alc
January 28, 2020, 11:23am
1
Hi all,
I updated to UD 2.8.2 and somehow broke my dashboard. I was just getting the loading cube and nothing else, with
[Error] Microsoft.AspNetCore.Server.Kestrel Connection id “0HLT3RSR872UR”, Request id “0HLT3RSR872UR:00000007”: An unhandled exception was thrown by the application.
in the logs. So I thought I’d re-check the documentation to see if I overwrote something. Looking at https://docs.universaldashboard.io/webserver/running-dashboards/iis it seems to be different from when I first went over to IIS a few months ago.
Old:
<aspNetCore processPath=".\net472\universaldashboard.server.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="C:\LogFiles\stdout" forwardWindowsAuthToken="false" />
New:
<aspNetCore processPath="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" arguments=".\dashboard.ps1" />
You can see the difference in the example at the top and bottom of the linked page.
I’ve got it working the ‘new’ way now and not sure if it’s placebo, but pages seem to load faster. Just wondered if I missed something?
2 Likes
adam
January 28, 2020, 1:49pm
2
The new way was the result of some discussion on another forum post where other users got it working this way to allow for hosting in pwsh.exe. It also it a lot simpler since you don’t need to copy so much around. The UD code for this hosting didn’t change at all, just the recommended configuration.
I’m not sure why it would be faster but that’s good news
1 Like
Second the “faster” part,
Noticable difference on certain parts!
Alc
January 28, 2020, 2:49pm
4
Ahha! At least I’m not going mad
How does this change impact utilizing Windows Auth with the forwardWindowsAuthToken="true"
option set on that same line within web.config?
Alc
January 30, 2020, 9:31am
7
Windows auth is working but I have noticed that my AdminModeAuthorizationPolicy does not seem to work any more.
$AdminPolicy = New-UDAuthorizationPolicy -Name 'Admin' -Endpoint {
param($user)
$User.Identity.Name -eq 'UK\harmanp'
}
$Auth = New-UDAuthenticationMethod -Windows
$LoginPage = New-UDLoginPage -AuthenticationMethod @($Auth) -PassThru -AuthorizationPolicy @($ITPolicy, $AdminPolicy)
$DashboardParams = @{
Title = $ConfigurationFile.dashboard.title
Theme = $SampleTheme
Pages = $Pages
EndpointInitialization = $Initialization
LoginPage = $LoginPage
AdminModeAuthorizationPolicy = 'Admin'
}
Start-UDDashboard -Dashboard $MyDashboard -Name $ConfigurationFile.dashboard.title -Endpoint $endpoint -Wait -AdminMode -AllowHttpForLogin
adam
January 30, 2020, 2:45pm
8
Interesting. There isn’t any difference in terms of how the dashboard is starting so I’m surprised that this is the case. I’ll have to fiddle with it.
Alc
February 4, 2020, 9:38am
9
Is anyone else able to reproduce my issue with the admin mode auth policy?
BoSen29
February 4, 2020, 10:50am
10
Hi @Alc
Could you check your logs?
It could be related to the auth-policy itself.
If so, do a convertto-json on the $User into a text file and analyze the stuff, validate that there is a single “Identity.Name”.
$Usable = $User.Identity.Name | Select-Object -first 1
$Usable -eq "UK\harmanp"
Give that one a go.
Try using
$User -eq “UK\harmanp”
cause i just tried with $User.Identity.Name and got an empty response but $User gave me what it seems like you are comparing against:
Alc
February 4, 2020, 5:01pm
12
No luck I’m afraid.
I thought… I know i’ll try running the dashboard.ps1 file in powershell directly rather than via IIS. So I removed -wait, shut down IIS but I just get
16:56:15 [Error] Microsoft.AspNetCore.Server.Kestrel Connection id “0HLT9I5T7BURR”, Request id “0HLT9I5T7BURR:00000002”: An unhandled exception was thrown by the application.
Not sure if I’ve missed something else?
As I say, adminmode was working fine before updating/switching to the new IIS mode.
adam
February 4, 2020, 5:10pm
13
Can you try to set forwardWindowsAuthToken to true?
<aspNetCore processPath="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" arguments=".\dashboard.ps1" forwardWindowsAuthToken="true" />
Alc
February 4, 2020, 5:11pm
14
Hi adam, yes it is already set to true
<aspNetCore processPath="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" arguments=".\dashboard.ps1" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="true" />
adam
February 4, 2020, 5:12pm
15
Ok. What happens when you just return true from the auth policy?
$AdminPolicy = New-UDAuthorizationPolicy -Name 'Admin' -Endpoint {
param($user)
$true
}
Alc
February 4, 2020, 5:25pm
16
Omg, I found it! Something in the theme is stopping the options from being displayed. If I comment out my theme then they appear
After finding this I initially thought maybe they are just black on black, but they do not seem to be there at all.
Any ideas what it could be in the theme?
adam
February 4, 2020, 5:26pm
17
Which theme are you using?
Alc
February 4, 2020, 5:27pm
18
adam
February 4, 2020, 5:32pm
19
Try Changing:
".ud-navbar" = @{
'width' = "100%"
'position' = "fixed"
'z-index' = "9999"
}
to
".ud-navbar" = @{
'z-index' = "9999"
}