authentication-dotnet-jwt

star 12

Đăng ký Jarvis JWT Bearer AddCoreJwtBearer và section Authentication Jwt. Dùng khi API cần xác thực Bearer token.

hoangnh2412 By hoangnh2412 schedule Updated 5/24/2026

name: authentication-dotnet-jwt description: Đăng ký Jarvis JWT Bearer AddCoreJwtBearer và section Authentication Jwt. Dùng khi API cần xác thực Bearer token. dependencies: - Jarvis.Authentications.Jwt

JWT Bearer

Package

<PackageReference Include="Jarvis.Authentications.Jwt" Version="1.0.1" />

Program.cs

using Jarvis.Authentication.Jwt;

builder.Services.AddAuthentication()
    .AddCoreJwtBearer(builder.Configuration);

appsettings.json

{
  "Authentication": {
    "Type": "Jwt",
    "Jwt": { }
  }
}

Chi tiết key JWT theo implementation package — bind từ IConfiguration, secret qua env.

Pipeline

app.UseAuthentication();
app.UseAuthorization();

Swagger

swashbuckle-dotnet/providers/jwt-securitySecuritySchemes: ["JWT"].

Validate

  • Endpoint [Authorize] → 401 không token
  • Swagger Authorize + gọi API thành công
Install via CLI
npx skills add https://github.com/hoangnh2412/jarvis --skill authentication-dotnet-jwt
Repository Details
star Stars 12
call_split Forks 2
navigation Branch main
article Path SKILL.md
More from Creator