身份验证
This commit is contained in:
17
Hotfix/Api/Helper/ApiJwtHelper.cs
Normal file
17
Hotfix/Api/Helper/ApiJwtHelper.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Text;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace NBF;
|
||||
|
||||
public static class ApiJwtHelper
|
||||
{
|
||||
public const string Issuer = "GameServer";
|
||||
public const string Audience = "GameClient";
|
||||
public const string Secret = "YourSuperSecretKeyForJwtTokenGeneration123!";
|
||||
public static readonly TimeSpan TokenLifetime = TimeSpan.FromDays(1);
|
||||
|
||||
public static SymmetricSecurityKey CreateSigningKey()
|
||||
{
|
||||
return new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Secret));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user