upgrade: fake 8.0.5.3
This commit is contained in:
parent
8c8647a0ca
commit
8c1fa38f4f
@ -1,6 +1,6 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- All Fake packages -->
|
<!-- All Fake packages -->
|
||||||
<FakePackageVersion>8.0.5.2</FakePackageVersion>
|
<FakePackageVersion>8.0.5.3</FakePackageVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
using System.Text;
|
|
||||||
using Microsoft.IdentityModel.Tokens;
|
|
||||||
|
|
||||||
namespace InterfaceForward.Api;
|
|
||||||
|
|
||||||
public class JWTEncryption
|
|
||||||
{
|
|
||||||
/// <summary>生成Token验证参数</summary>
|
|
||||||
/// <param name="jwtSettings"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static TokenValidationParameters CreateTokenValidationParameters(
|
|
||||||
JWTSettingsOptions jwtSettings)
|
|
||||||
{
|
|
||||||
return new TokenValidationParameters()
|
|
||||||
{
|
|
||||||
ValidateIssuerSigningKey = jwtSettings.ValidateIssuerSigningKey,
|
|
||||||
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtSettings.IssuerSigningKey)),
|
|
||||||
ValidateIssuer = jwtSettings.ValidateIssuer,
|
|
||||||
ValidIssuer = jwtSettings.ValidIssuer,
|
|
||||||
ValidateAudience = jwtSettings.ValidateAudience,
|
|
||||||
ValidAudience = jwtSettings.ValidAudience,
|
|
||||||
ValidateLifetime = jwtSettings.ValidateLifetime,
|
|
||||||
ClockSkew = TimeSpan.FromSeconds(jwtSettings.ClockSkew),
|
|
||||||
RequireExpirationTime = jwtSettings.RequireExpirationTime
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
namespace InterfaceForward.Api;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Jwt 配置</summary>
|
|
||||||
public sealed class JWTSettingsOptions
|
|
||||||
{
|
|
||||||
/// <summary>验证签发方密钥</summary>
|
|
||||||
public bool ValidateIssuerSigningKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>签发方密钥</summary>
|
|
||||||
public string IssuerSigningKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>验证签发方</summary>
|
|
||||||
public bool ValidateIssuer { get; set; }
|
|
||||||
|
|
||||||
/// <summary>签发方</summary>
|
|
||||||
public string ValidIssuer { get; set; }
|
|
||||||
|
|
||||||
/// <summary>验证签收方</summary>
|
|
||||||
public bool ValidateAudience { get; set; }
|
|
||||||
|
|
||||||
/// <summary>签收方</summary>
|
|
||||||
public string ValidAudience { get; set; }
|
|
||||||
|
|
||||||
/// <summary>验证生存期</summary>
|
|
||||||
public bool ValidateLifetime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>过期时间容错值,解决服务器端时间不同步问题(秒)</summary>
|
|
||||||
public long ClockSkew { get; set; }
|
|
||||||
|
|
||||||
/// <summary>过期时间(分钟)</summary>
|
|
||||||
public long ExpiredTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>加密算法</summary>
|
|
||||||
public string Algorithm { get; set; }
|
|
||||||
|
|
||||||
/// <summary>验证过期时间,设置 false 永不过期</summary>
|
|
||||||
public bool RequireExpirationTime { get; set; } = true;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user