Browse Source

fix: Security logs need to be included in the same unit of work.

pull/593/head
cKey 4 years ago
parent
commit
c345725155
  1. 2
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN/Abp/IdentityServer/LinkUser/LinkUserGrantValidator.cs
  2. 4
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs

2
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN/Abp/IdentityServer/LinkUser/LinkUserGrantValidator.cs

@ -9,6 +9,7 @@ using Volo.Abp.Identity;
using Volo.Abp.IdentityServer.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Security.Claims;
using Volo.Abp.Uow;
using Volo.Abp.Users;
namespace LINGYUN.Abp.IdentityServer.LinkUser;
@ -51,6 +52,7 @@ public class LinkUserGrantValidator : IExtensionGrantValidator
Localizer = localizer;
}
[UnitOfWork]
public virtual async Task ValidateAsync(ExtensionGrantValidationContext context)
{
var accessToken = context.Request.Raw["access_token"];

4
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs

@ -14,7 +14,7 @@ using Volo.Abp.Identity;
using Volo.Abp.IdentityServer;
using Volo.Abp.IdentityServer.Localization;
using Volo.Abp.Security.Claims;
using Volo.Abp.Uow;
using IdentityResource = Volo.Abp.Identity.Localization.IdentityResource;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
using IIdentityUserRepository = LINGYUN.Abp.Identity.IIdentityUserRepository;
@ -27,6 +27,7 @@ namespace LINGYUN.Abp.IdentityServer.SmsValidator
protected IEventService EventService { get; }
protected IIdentityUserRepository UserRepository { get; }
protected UserManager<IdentityUser> UserManager { get; }
protected SignInManager<IdentityUser> SignInManager { get; }
protected IdentitySecurityLogManager IdentitySecurityLogManager { get; }
protected IStringLocalizer<IdentityResource> IdentityLocalizer { get; }
protected IStringLocalizer<AbpIdentityServerResource> IdentityServerLocalizer { get; }
@ -51,6 +52,7 @@ namespace LINGYUN.Abp.IdentityServer.SmsValidator
public string GrantType => SmsValidatorConsts.SmsValidatorGrantTypeName;
[UnitOfWork]
public async Task ValidateAsync(ExtensionGrantValidationContext context)
{
var raw = context.Request.Raw;

Loading…
Cancel
Save