we are using OpenIdDict with Auth Server and resource server as two separate project and two separate url. It works in local and as alpha1 but fail in stage where we have load balancer. it works with single server. we use Dataprotection keys also Error in logs :
[Error] [OpenIddict.Validation.OpenIddictValidationDispatcher] A network error occured while communicating with the remote HTTP server.
System.Net.Http.HttpRequestException: No such host is known. (xxx-www.yyyy.zzz.com:443)
---> System.Net.Sockets.SocketException (11001): No such host is known.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Extensions.Http.PolicyHttpMessageHandler.SendCoreAsync(HttpRequestMessage request, Context context, CancellationToken cancellationToken) at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func
3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates1 shouldRetryResultPredicates, Func
5 onRetryAsync, Int32 permittedRetryCount, IEnumerable1 sleepDurationsEnumerable, Func
4 sleepDurationProvider, Boolean continueOnCapturedContext)
at Polly.AsyncPolicy1.ExecuteAsync(Func
3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
at Microsoft.Extensions.Http.PolicyHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at OpenIddict.Validation.SystemNetHttp.OpenIddictValidationSystemNetHttpHandlers.SendHttpRequest`1.HandleAsync(TContext context)
23:26:38.499 +01:00 [Error] [OpenIddict.Validation.OpenIddictValidationDispatcher] An error occurred while retrieving the configuration of the remote authorization server.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: [PII of type System.String is hidden. For more details, see https://aka.ms/IdentityModel/PII.] .
---> OpenIddict.Abstractions.OpenIddictExceptions+ProtocolException: An error occurred while sending the configuration request.
Error: server_error
Error description: An error occurred while communicating with the remote HTTP server.
Error URI: https://documentation.openiddict.com/errors/ID2136
at OpenIddict.Validation.OpenIddictValidationService.<>c__DisplayClass3_0.<g__ApplyConfigurationRequestAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
at OpenIddict.Validation.OpenIddictValidationService.GetConfigurationAsync(Uri uri, CancellationToken cancellationToken)
at OpenIddict.Validation.OpenIddictValidationService.GetConfigurationAsync(Uri uri, CancellationToken cancellationToken)
at OpenIddict.Validation.OpenIddictValidationRetriever.Microsoft.IdentityModel.Protocols.IConfigurationRetriever<OpenIddict.Abstractions.OpenIddictConfiguration>.GetConfigurationAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager1.GetConfigurationAsync(CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.ConfigurationManager
1.GetConfigurationAsync(CancellationToken cancel)
at OpenIddict.Validation.OpenIddictValidationHandlers.ResolveServerConfiguration.HandleAsync(ProcessAuthenticationContext context)
23:26:38.509 +01:00 [Information] [OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandler] "OpenIddict.Validation.AspNetCore" was not authenticated. Failure message: "An error occurred while authenticating the current request."
23:26:38.596 +01:00 [Information] [OpenIddict.Validation.OpenIddictValidationDispatcher] The response was successfully returned as a challenge response: "{ "error": "server_error", "error_description": "The remote authorization server is currently unavailable or returned an invalid configuration.", "error_uri": "https://documentation.openiddict.com/errors/ID2170" }".