diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs b/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs index 3f3485552..9c298699c 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs @@ -80,11 +80,11 @@ namespace LINGYUN.Abp.IdentityServer.WeChatValidator Localizer["InvalidGrant:WeChatCodeNotFound"]); return; } - var whchatOpenId = await WeChatOpenIdFinder.FindAsync(wechatCode); - var currentUser = await UserManager.FindByLoginAsync("WeChat", whchatOpenId.OpenId); + var wechatOpenId = await WeChatOpenIdFinder.FindAsync(wechatCode); + var currentUser = await UserManager.FindByLoginAsync("WeChat", wechatOpenId.OpenId); if(currentUser == null) { - Logger.LogWarning("Invalid grant type: wechat openid: {0} not register", whchatOpenId.OpenId); + Logger.LogWarning("Invalid grant type: wechat openid: {0} not register", wechatOpenId.OpenId); context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, Localizer["InvalidGrant:WeChatNotRegister"]); return; @@ -96,9 +96,9 @@ namespace LINGYUN.Abp.IdentityServer.WeChatValidator { additionalClaims.Add(new Claim(AbpClaimTypes.TenantId, currentUser.TenantId?.ToString())); } - additionalClaims.Add(new Claim(WeChatValidatorConsts.ClaimTypes.OpenId, whchatOpenId.OpenId)); + additionalClaims.Add(new Claim(WeChatValidatorConsts.ClaimTypes.OpenId, wechatOpenId.OpenId)); - await EventService.RaiseAsync(new UserLoginSuccessEvent(currentUser.UserName, whchatOpenId.OpenId, null)); + await EventService.RaiseAsync(new UserLoginSuccessEvent(currentUser.UserName, wechatOpenId.OpenId, null)); context.Result = new GrantValidationResult(sub, WeChatValidatorConsts.AuthenticationMethods.BasedWeChatAuthentication, additionalClaims.ToArray()); } diff --git a/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs b/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs index 9966fd96d..158d89a7b 100644 --- a/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs +++ b/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs @@ -79,6 +79,10 @@ namespace AuthServer.Host }) .UseDashboard(); }); + + PreConfigure(builder => + { + }); } public override void ConfigureServices(ServiceConfigurationContext context) @@ -185,8 +189,10 @@ namespace AuthServer.Host app.UseAbpRequestLocalization(); app.UseRouting(); app.UseCors(DefaultCorsPolicyName); + app.UseAuthentication(); app.UseMultiTenancy(); app.UseIdentityServer(); + app.UseAuthorization(); app.UseAuditing(); app.UseConfiguredEndpoints(); diff --git a/aspnet-core/services/account/AuthServer.Host/package.json b/aspnet-core/services/account/AuthServer.Host/package.json index 412aab56a..288627147 100644 --- a/aspnet-core/services/account/AuthServer.Host/package.json +++ b/aspnet-core/services/account/AuthServer.Host/package.json @@ -3,6 +3,6 @@ "name": "my-app-identityserver", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.6.2" + "@abp/aspnetcore.mvc.ui.theme.basic": "3.0.0" } }