Browse Source

Update AbpAspNetCoreServiceCollectionExtensions.cs

pull/13167/head
maliming 4 years ago
parent
commit
481d031c3e
No known key found for this signature in database GPG Key ID: 96224957E51C89E
  1. 4
      modules/identity/src/Volo.Abp.Identity.AspNetCore/Microsoft/AspNetCore/Extensions/DependencyInjection/AbpAspNetCoreServiceCollectionExtensions.cs

4
modules/identity/src/Volo.Abp.Identity.AspNetCore/Microsoft/AspNetCore/Extensions/DependencyInjection/AbpAspNetCoreServiceCollectionExtensions.cs

@ -5,7 +5,7 @@ namespace Microsoft.AspNetCore.Extensions.DependencyInjection;
public static class AbpAspNetCoreServiceCollectionExtensions public static class AbpAspNetCoreServiceCollectionExtensions
{ {
public static IServiceCollection ForwardIdentityAuthenticationForBearer(this IServiceCollection services, string targetAuthenticationScheme = "Bearer") public static IServiceCollection ForwardIdentityAuthenticationForBearer(this IServiceCollection services, string jwtBearerScheme = "Bearer")
{ {
services.ConfigureApplicationCookie(options => services.ConfigureApplicationCookie(options =>
{ {
@ -14,7 +14,7 @@ public static class AbpAspNetCoreServiceCollectionExtensions
string authorization = ctx.Request.Headers.Authorization; string authorization = ctx.Request.Headers.Authorization;
if (!authorization.IsNullOrWhiteSpace() && authorization.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) if (!authorization.IsNullOrWhiteSpace() && authorization.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase))
{ {
return targetAuthenticationScheme; return jwtBearerScheme;
} }
return null; return null;

Loading…
Cancel
Save