chore: Change RequireHttpsMetadata for docker env

This commit is contained in:
meysamhadeli 2023-02-12 20:17:34 +03:30
parent 765912dc03
commit 5795ce328c
4 changed files with 8 additions and 4 deletions

View File

@ -52,6 +52,8 @@ services:
####################################################### #######################################################
# EventStoreDB # EventStoreDB
####################################################### #######################################################
#https://stackoverflow.com/questions/65272764/ports-are-not-available-listen-tcp-0-0-0-0-50070-bind-an-attempt-was-made-to
eventstore: eventstore:
container_name: eventstore container_name: eventstore
image: eventstore/eventstore:21.2.0-buster-slim image: eventstore/eventstore:21.2.0-buster-slim

View File

@ -1,4 +1,3 @@
using BuildingBlocks.Utils;
using BuildingBlocks.Web; using BuildingBlocks.Web;
using Duende.IdentityServer.Models; using Duende.IdentityServer.Models;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
@ -17,6 +16,7 @@ public static class JwtExtensions
{ {
options.Authority = jwtOptions.Authority; options.Authority = jwtOptions.Authority;
options.TokenValidationParameters.ValidateAudience = false; options.TokenValidationParameters.ValidateAudience = false;
options.RequireHttpsMetadata = jwtOptions.RequireHttpsMetadata;
}); });
if (!string.IsNullOrEmpty(jwtOptions.Audience)) if (!string.IsNullOrEmpty(jwtOptions.Audience))

View File

@ -23,8 +23,9 @@
"ConnectionString": "Server=postgres;Port=5432;Database=flight;User Id=postgres;Password=postgres;Include Error Detail=true" "ConnectionString": "Server=postgres;Port=5432;Database=flight;User Id=postgres;Password=postgres;Include Error Detail=true"
}, },
"Jwt": { "Jwt": {
"Authority": "identity:5005", "Authority": "http://myidentityserver.com",
"Audience": "flight-api" "Audience": "flight-api",
"RequireHttpsMetadata": false
}, },
"RabbitMq": { "RabbitMq": {
"HostName": "rabbitmq", "HostName": "rabbitmq",

View File

@ -30,7 +30,8 @@
}, },
"Jwt": { "Jwt": {
"Authority": "https://localhost:5005", "Authority": "https://localhost:5005",
"Audience": "flight-api" "Audience": "flight-api",
"RequireHttpsMetadata": true
}, },
"RabbitMqOptions": { "RabbitMqOptions": {
"HostName": "localhost", "HostName": "localhost",