Skip to content

Commit

Permalink
Fix when using default auth options
Browse files Browse the repository at this point in the history
  • Loading branch information
jabbera committed Jan 30, 2019
1 parent 0622d70 commit 9c1a26f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public Startup(IConfiguration configuration)
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer();
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
});
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)

builder.ConfigureTestServices(services =>
{
services.AddAuthentication(x => x.DefaultScheme = ClaimInjectorHandler.AuthenticationScheme)
services.AddAuthentication(x =>
{
x.DefaultScheme = ClaimInjectorHandler.AuthenticationScheme;
x.DefaultAuthenticateScheme = ClaimInjectorHandler.AuthenticationScheme;
x.DefaultChallengeScheme = ClaimInjectorHandler.AuthenticationScheme;
})
.AddScheme<ClaimInjectorHandlerOptions, ClaimInjectorHandler>(ClaimInjectorHandler.AuthenticationScheme,
x => { });
});
Expand Down

0 comments on commit 9c1a26f

Please sign in to comment.