Browse Source

Fix issue with AddAuthentication and no default Schema on Marketing.API

pull/335/head
Unai Zorrilla Castro 7 years ago
parent
commit
be6e276bff
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/Services/Marketing/Marketing.API/Startup.cs

+ 7
- 2
src/Services/Marketing/Marketing.API/Startup.cs View File

@ -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…
Cancel
Save