diff --git a/src/Alba/Alba.csproj b/src/Alba/Alba.csproj index c9f4045a..ebe8c6e2 100644 --- a/src/Alba/Alba.csproj +++ b/src/Alba/Alba.csproj @@ -8,7 +8,7 @@ Alba Alba http://jasperfx.github.io/alba/ - https://raw.githubusercontent.com/JasperFx/alba/master/LICENSE + Apache-2.0 git git://github.com/JasperFx/alba library diff --git a/src/Alba/Security/OpenConnectExtension.cs b/src/Alba/Security/OpenConnectExtension.cs index 13f8d66c..adb1ec90 100644 --- a/src/Alba/Security/OpenConnectExtension.cs +++ b/src/Alba/Security/OpenConnectExtension.cs @@ -42,7 +42,7 @@ async Task IAlbaExtension.Start(IAlbaHost host) // This seems to be necessary to "bake" in the JwtBearerOptions modifications var options = host.Services.GetRequiredService>() - .Get("Bearer"); + .Get(JwtBearerDefaults.AuthenticationScheme); var authorityUrl = options.Authority; _disco = await _client.GetDiscoveryDocumentAsync(authorityUrl); diff --git a/src/WebAppSecuredWithJwt/Startup.cs b/src/WebAppSecuredWithJwt/Startup.cs index b5b2fd4d..2fd26565 100644 --- a/src/WebAppSecuredWithJwt/Startup.cs +++ b/src/WebAppSecuredWithJwt/Startup.cs @@ -4,6 +4,7 @@ using System.Security.Claims; using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; @@ -35,9 +36,9 @@ public void ConfigureServices(IServiceCollection services) c.SwaggerDoc("v1", new OpenApiInfo {Title = "WebAppSecuredWithJwt", Version = "v1"}); }); - services.AddAuthentication("Bearer") + services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) - .AddJwtBearer("Bearer", options => + .AddJwtBearer(options => { // A real application would pull all this information from configuration // of course, but I'm hardcoding it in testing