- Admin/Manager/User Login
- Identity protected with JWT token with refresh token supported.
- CRUD on Employees data.
- Report Generation.
- Print out
- User/Manager Management ONLY by the Administrator.
Server: ASP .NET Core Web API
Client: Blazor WebAssembly Standalone APP
Tools -> NuGet Package Manager -> Package Manager Console
DefaultProject: ServerLibrary
Add-Migration First -o Data/Migrations
Add-Migration -o Data/Migrations
Name: First
Update-Database
I got this error when running the command, you can reload the Client project to avoid this error.
The server name of the connection string needs to match your SQL Server's instance name.
DefaultProject: ServerLibrary
Add-Migration AddRoles
Update-Database
Add-Migration TokenInfo
Update-Database
openssl rand -base64 32
Or
- Create a new Console APP
dotnet new console -n JwtKeyGenerator
cd JwtKeyGenerator
Program.cs
using System;
using System.Security.Cryptography;
class Program
{
static void Main()
{
var key = new byte[32]; // 256-bit key
using (var rng = RandomNumberGenerator.Create())
{
rng.GetBytes(key);
}
string base64Key = Convert.ToBase64String(key);
Console.WriteLine("Generated JWT Key:");
Console.WriteLine(base64Key);
}
}
dotnet run