Skip to content

Instantly share code, notes, and snippets.

@blaiseAI
Created June 14, 2024 01:03
Show Gist options
  • Save blaiseAI/686809de811dc791e74de12e4c2d2d2b to your computer and use it in GitHub Desktop.
Save blaiseAI/686809de811dc791e74de12e4c2d2d2b to your computer and use it in GitHub Desktop.
Authentication With Authorization Dotnet
Notes for Basic Authentication/Authorization in Blazor
Resources:
ASP.NET Core Blazor authentication and authorization
https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-3.1
IdentityManager
https://github.com/mguinness/IdentityManager/
Download: https://github.com/mguinness/IdentityManager/archive/master.zip
Customize IdentityManager:
Startup.cs:
Change:
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
To:
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
appsettings.json:
Change "DefaultConnection" to your app's Identity DB connection string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment