I’m trying to get basic dashboard authorization working in my MVC VB.Net app. I just want to be able to add one user “admin” and a basic password “123”. I’ve tried various methods from here and nothing has worked so far (using 1.6.6):
Dim options As New DashboardOptions
options.Authorization = New IDashboardAuthorizationFilter() {
New AuthorizationFilter With {.Users = “some_user”, .Roles = “some_role”}
}
This is probably really bad form - but this is how I got it to work in VB.net. I ended up breaking apart the sections.
Dim user1 = New BasicAuthAuthorizationUser With {.Login = "admin", .PasswordClear = "mysupersecretpassword"}
Dim userList As New List(Of BasicAuthAuthorizationUser)
userList.Add(user1)
filterOptions.Users = userList
Dim filter = New BasicAuthAuthorizationFilter(filterOptions)
Dim filters As New List(Of BasicAuthAuthorizationFilter)
filters.Add(filter)
Dim options = New DashboardOptions() With {.AuthorizationFilters = filters.AsEnumerable}
app.UseHangfireDashboard("/hangfire", options)
GlobalConfiguration.Configuration.UseConsole()