- IJwtService/JwtService에 GetTokenInfo(JTI, 만료시간 추출) 추가
- LogoutAsync에 Redis 블랙리스트 로직 추가 (key: blacklist:{jti}, TTL: 남은 만료시간)
- AuthenticationExtensions OnTokenValidated에서 블랙리스트 체크
- 로그아웃 후 동일 Access Token 재사용 시 401 반환
Closes #169
12 lines
346 B
C#
12 lines
346 B
C#
using System.Security.Claims;
|
|
|
|
namespace SPMS.Application.Interfaces;
|
|
|
|
public interface IJwtService
|
|
{
|
|
string GenerateAccessToken(long adminId, string role, string? serviceCode = null);
|
|
ClaimsPrincipal? ValidateAccessToken(string token);
|
|
string GenerateRefreshToken();
|
|
(string? Jti, DateTime ValidTo) GetTokenInfo(string token);
|
|
}
|