Browse Source

Revert "jwt"

This reverts commit 248d498c4f2fe7543e41918891295ec380e74d27.
CrazyIter 5 years ago
parent
commit
10c7474085

+ 1 - 1
TEAMModelOS.SDK/Extension/JwtAuth/JwtAuthExtension.cs

@@ -20,7 +20,7 @@ namespace TEAMModelOS.SDK.Extension.JwtAuth
             // var creds = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["SecurityKey"]), SecurityAlgorithms.RsaSha256Signature);
             //var creds = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["SecurityKey"]));
             string path = BaseConfigModel.ContentRootPath;
-            RsaSecurityKey creds = new RsaSecurityKey(RsaHelper.LoadCertificateFile(path + "/private.pem"));
+            RsaSecurityKey creds = new RsaSecurityKey(RsaHelper.LoadCertificateFile(path + "/JwtRsaFile/private.pem"));
             //RsaSecurityKey creds = new SigningCredentials(new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["SecurityKey"])), SecurityAlgorithms.RsaSha256Signature);
             // 令牌验证参数
             var tokenValidationParameters = new TokenValidationParameters

+ 1 - 1
TEAMModelOS.SDK/Extension/JwtAuth/JwtHelper/JwtHelper.cs

@@ -46,7 +46,7 @@ namespace TEAMModelOS.SDK.Extension.JwtAuth.JwtHelper
             //claims.AddRange(claimModel.Roles.Select(s=>new Claim(JwtClaimTypes.Role, s)));
             //claims.AddRange(claimModel.Claims.Select(s => new Claim(ClaimTypes.Role, s)));
             string path = BaseConfigModel.ContentRootPath;
-            RSACryptoServiceProvider provider = RsaHelper.LoadCertificateFile(path + "/private.pem");
+            RSACryptoServiceProvider provider = RsaHelper.LoadCertificateFile(path + "/JwtRsaFile/private.pem");
             RsaSecurityKey rsaSecurity = new RsaSecurityKey(provider);
             var creds =new SigningCredentials(rsaSecurity, SecurityAlgorithms.RsaSha256);
 

TEAMModelOS/private.pem → TEAMModelOS/JwtRsaFile/private.pem


TEAMModelOS/public.pem → TEAMModelOS/JwtRsaFile/public.pem


+ 1 - 0
TEAMModelOS/TEAMModelOS.csproj

@@ -26,6 +26,7 @@
   <ItemGroup>
     <Folder Include="JsonFile\Subject\" />
     <Folder Include="wwwroot\" />
+    <Folder Include="JwtRsaFile\" />
   </ItemGroup>
   
   <ItemGroup>