Skip to content

Blazor Server with Windows Authentication and Active Directory

Notifications You must be signed in to change notification settings

CyberEdX/BlazorServerWindowsAuth

Repository files navigation

BlazorServerWindowsAuth

BlazorServer-Windows-Auth-example

Blazor Server with Windows Authentication / Authorization

BlazorServerWinAuth

  • Updates on Program.cs:
builder.Services.AddAuthorization(options => { // By default, all incoming requests will be authorized according to the default policy. options.FallbackPolicy = options.DefaultPolicy; options.AddPolicy("IsSupport", policy => policy.RequireRole("Support")); options.AddPolicy("IsUser", policy => policy.RequireRole("User")); options.AddPolicy("IsAdmin", policy => policy.RequireRole("Support", "Admin")); }); ... builder.Services.AddSingleton(); builder.Services.AddTransient();

Under Data folder:

  • Class Services: public class AppClaimsTransformation : IClaimsTransformation public class UserInfoService

  • Class Model: public class UserInfoAD

Under Shared folder (updated and new components):

  • LoginDisplay (updated)
  • FooterLayout (new)
  • SupportLabel (new)

Links:

About

Blazor Server with Windows Authentication and Active Directory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published