Fix issue with AddAuthentication and no default Schema on Marketing.API
This commit is contained in:
parent
69b914172f
commit
be6e276bff
@ -21,6 +21,7 @@
|
||||
using Infrastructure.Services;
|
||||
using IntegrationEvents.Events;
|
||||
using Marketing.API.IntegrationEvents.Handlers;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using RabbitMQ.Client;
|
||||
using Swashbuckle.AspNetCore.Swagger;
|
||||
@ -199,8 +200,12 @@
|
||||
// prevent from mapping "sub" claim to nameidentifier.
|
||||
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
|
||||
|
||||
services.AddAuthentication()
|
||||
.AddJwtBearer(options =>
|
||||
services.AddAuthentication(options=>
|
||||
{
|
||||
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
|
||||
}).AddJwtBearer(options =>
|
||||
{
|
||||
options.Authority = Configuration.GetValue<string>("IdentityUrl");
|
||||
options.Audience = "marketing";
|
||||
|
Loading…
x
Reference in New Issue
Block a user