Browse Source
Update AbpAspNetCoreServiceCollectionExtensions.cs
pull/13167/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: 96224957E51C89E
1 changed files with
2 additions and
2 deletions
-
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 IServiceCollection ForwardIdentityAuthenticationForBearer(this IServiceCollection services, string targetAuthenticationScheme = "Bearer") |
|
|
|
public static IServiceCollection ForwardIdentityAuthenticationForBearer(this IServiceCollection services, string jwtBearerScheme = "Bearer") |
|
|
|
{ |
|
|
|
services.ConfigureApplicationCookie(options => |
|
|
|
{ |
|
|
|
@ -14,7 +14,7 @@ public static class AbpAspNetCoreServiceCollectionExtensions |
|
|
|
string authorization = ctx.Request.Headers.Authorization; |
|
|
|
if (!authorization.IsNullOrWhiteSpace() && authorization.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) |
|
|
|
{ |
|
|
|
return targetAuthenticationScheme; |
|
|
|
return jwtBearerScheme; |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|