- IJwtService 인터페이스 (Application Layer) - JwtSettings POCO (Options Pattern) - JwtService 구현 (Access Token 생성/검증, Refresh Token 생성) - AddJwtAuthentication/AddAuthorizationPolicies 확장 메서드 - Program.cs에 인증/인가 미들웨어 등록 (파이프라인 순서 10~11번) - NuGet: System.IdentityModel.Tokens.Jwt, Microsoft.AspNetCore.Authentication.JwtBearer
13 lines
397 B
C#
13 lines
397 B
C#
namespace SPMS.Application.Settings;
|
|
|
|
public class JwtSettings
|
|
{
|
|
public const string SectionName = "JwtSettings";
|
|
|
|
public string SecretKey { get; set; } = string.Empty;
|
|
public string Issuer { get; set; } = string.Empty;
|
|
public string Audience { get; set; } = string.Empty;
|
|
public int ExpiryMinutes { get; set; } = 60;
|
|
public int RefreshTokenExpiryDays { get; set; } = 7;
|
|
}
|