mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 20:03:26 +08:00
【优化】JWT加密模式进行优化,SecretKey值增加机器码、计算机名、网址组合md5加密,防止出现大家不修改默认值导致JwtToken权限过宽的问题;Issuer增加为空使用计算机名替换,appsetting.json去除JwtConfig的默认值,要求输入设置。
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar.Extensions;
|
||||
@@ -71,8 +72,8 @@ namespace CoreCms.Net.Configuration
|
||||
|
||||
#region Jwt授权配置================================================================================
|
||||
|
||||
public static readonly string JwtConfigSecretKey = AppSettingsHelper.GetContent("JwtConfig", "SecretKey");
|
||||
public static readonly string JwtConfigIssuer = AppSettingsHelper.GetContent("JwtConfig", "Issuer");
|
||||
public static readonly string JwtConfigSecretKey = AppSettingsHelper.GetContent("JwtConfig", "SecretKey") + AppSettingsHelper.GetMachineRandomKey(DbSqlConnection + AppSettingsHelper.GetMACIp(true));
|
||||
public static readonly string JwtConfigIssuer = !string.IsNullOrEmpty(AppSettingsHelper.GetContent("JwtConfig", "Issuer")) ? AppSettingsHelper.GetContent("JwtConfig", "Issuer") : AppSettingsHelper.GetHostName();
|
||||
public static readonly string JwtConfigAudience = AppSettingsHelper.GetContent("JwtConfig", "Audience");
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user