You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
668 B
25 lines
668 B
2 years ago
|
using System.Security.Claims;
|
||
|
|
||
|
namespace BuaaLocationServer.Middlewares.Jwts
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// JWT 服务器接口。
|
||
|
/// </summary>
|
||
|
public interface IJwtService
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 创建一个 JWT。
|
||
|
/// </summary>
|
||
|
/// <param name="identity"></param>
|
||
|
/// <returns></returns>
|
||
|
string Create(ClaimsIdentity identity);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 验证 JWT 是否有效。
|
||
|
/// </summary>
|
||
|
/// <param name="token"></param>
|
||
|
/// <param name="principal"></param>
|
||
|
/// <returns></returns>
|
||
|
bool Validate(string token, out ClaimsPrincipal principal);
|
||
|
}
|
||
|
}
|