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 Infrastructure.Services;
|
||||||
using IntegrationEvents.Events;
|
using IntegrationEvents.Events;
|
||||||
using Marketing.API.IntegrationEvents.Handlers;
|
using Marketing.API.IntegrationEvents.Handlers;
|
||||||
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||||
using RabbitMQ.Client;
|
using RabbitMQ.Client;
|
||||||
using Swashbuckle.AspNetCore.Swagger;
|
using Swashbuckle.AspNetCore.Swagger;
|
||||||
@ -199,8 +200,12 @@
|
|||||||
// prevent from mapping "sub" claim to nameidentifier.
|
// prevent from mapping "sub" claim to nameidentifier.
|
||||||
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
|
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
|
||||||
|
|
||||||
services.AddAuthentication()
|
services.AddAuthentication(options=>
|
||||||
.AddJwtBearer(options =>
|
{
|
||||||
|
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
|
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
|
|
||||||
|
}).AddJwtBearer(options =>
|
||||||
{
|
{
|
||||||
options.Authority = Configuration.GetValue<string>("IdentityUrl");
|
options.Authority = Configuration.GetValue<string>("IdentityUrl");
|
||||||
options.Audience = "marketing";
|
options.Audience = "marketing";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user