mirror of https://github.com/abpframework/abp.git
committed by
GitHub
18 changed files with 110 additions and 44 deletions
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
|
|||
namespace Microsoft.AspNetCore.Extensions.DependencyInjection; |
|||
|
|||
public static class AbpAspNetCoreServiceCollectionExtensions |
|||
{ |
|||
public static IServiceCollection ForwardIdentityAuthenticationForBearer(this IServiceCollection services, string jwtBearerScheme = "Bearer") |
|||
{ |
|||
services.ConfigureApplicationCookie(options => |
|||
{ |
|||
options.ForwardDefaultSelector = ctx => |
|||
{ |
|||
string authorization = ctx.Request.Headers.Authorization; |
|||
if (!authorization.IsNullOrWhiteSpace() && authorization.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) |
|||
{ |
|||
return jwtBearerScheme; |
|||
} |
|||
|
|||
return null; |
|||
}; |
|||
}); |
|||
|
|||
return services; |
|||
} |
|||
} |
|||
@ -0,0 +1 @@ |
|||
export type PasswordRule = 'small' | 'capital' | 'number' | 'special'; |
|||
Loading…
Reference in new issue