Skip to content

Commit

Permalink
Update AbpDynamicClaimsMiddleware.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
EngincanV committed Aug 26, 2024
1 parent 7e18999 commit 3901625
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public async override Task InvokeAsync(HttpContext context, RequestDelegate next
var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>();
var authenticationType = authenticateResultFeature?.AuthenticateResult?.Ticket?.AuthenticationScheme ?? context.User.Identity.AuthenticationType;

var abpClaimsPrincipalFactory = context.RequestServices.GetRequiredService<IAbpClaimsPrincipalFactory>();
var user = await abpClaimsPrincipalFactory.CreateDynamicAsync(context.User);

if (authenticateResultFeature != null && !authenticationType.IsNullOrWhiteSpace())
{
var abpClaimsPrincipalFactory = context.RequestServices.GetRequiredService<IAbpClaimsPrincipalFactory>();
var user = await abpClaimsPrincipalFactory.CreateDynamicAsync(context.User);

authenticateResultFeature.AuthenticateResult = AuthenticateResult.Success(new AuthenticationTicket(user, authenticationType));
var httpAuthenticationFeature = context.Features.Get<IHttpAuthenticationFeature>();
if (httpAuthenticationFeature != null)
Expand Down

0 comments on commit 3901625

Please sign in to comment.