From 63ba5eccfe7c59b35a2a9767e8da6bd148a525be Mon Sep 17 00:00:00 2001 From: Sebastian Gingter Date: Tue, 22 Aug 2023 12:18:38 +0200 Subject: [PATCH] fix(server): recover faster when IdSrv isn't reachable --- src/docker/Thinktecture.Relay.Server.Docker/Startup.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/docker/Thinktecture.Relay.Server.Docker/Startup.cs b/src/docker/Thinktecture.Relay.Server.Docker/Startup.cs index ce148e179..c914c28f4 100644 --- a/src/docker/Thinktecture.Relay.Server.Docker/Startup.cs +++ b/src/docker/Thinktecture.Relay.Server.Docker/Startup.cs @@ -30,6 +30,11 @@ public void ConfigureServices(IServiceCollection services) options.Authority = authorityUri.AbsoluteUri; options.Audience = Constants.AuthenticationAudience; options.RequireHttpsMetadata = authorityUri.Scheme == "https"; + + // This is a demo environment, we should try to recover fast if we can't access our Identity Provider + // when fetching its OpenId configuration. Otherwise we would stay in failed state in the MS JwtBearer + // ConfigurationManager until its default refresh interval of 5 minutes passed. + options.RefreshInterval = TimeSpan.FromSeconds(15); }); services.AddRelayServerDbContext(Configuration.GetConnectionString("PostgreSql")