chat
This commit is contained in:
@@ -29,24 +29,25 @@ public static class AuthenticationJwtComponentSystem
|
||||
ValidateIssuer = true, // 验证发行者
|
||||
ValidateAudience = true, // 验证受众
|
||||
ValidateIssuerSigningKey = true, // 验证签名密钥
|
||||
ValidIssuer = "Fantasy", // 有效的发行者
|
||||
ValidAudience = "Fantasy", // 有效的受众
|
||||
ValidIssuer = "NoBug", // 有效的发行者
|
||||
ValidAudience = "NoBug", // 有效的受众
|
||||
IssuerSigningKey = new RsaSecurityKey(rsa) // RSA公钥作为签名密钥
|
||||
};
|
||||
}
|
||||
|
||||
public static string GetToken(this AuthenticationJwtComponent self, long aId, string address, uint sceneId)
|
||||
public static string GetToken(this AuthenticationJwtComponent self, long aId, string address, uint sceneId, int region)
|
||||
{
|
||||
var jwtPayload = new JwtPayload()
|
||||
{
|
||||
{ "aId", aId },
|
||||
{ "Address", address },
|
||||
{ "SceneId", sceneId }
|
||||
{ "SceneId", sceneId },
|
||||
{ "Region", region },
|
||||
};
|
||||
|
||||
var jwtSecurityToken = new JwtSecurityToken(
|
||||
issuer: "Fantasy",
|
||||
audience: "Fantasy",
|
||||
issuer: "NoBug",
|
||||
audience: "NoBug",
|
||||
claims: jwtPayload.Claims,
|
||||
expires: DateTime.UtcNow.AddMilliseconds(3000),
|
||||
signingCredentials: self.SigningCredentials);
|
||||
|
||||
Reference in New Issue
Block a user