# IDX20804: Unable to retrieve document from:not working on deployed application working on localhost

**URL:** <https://devforum.okta.com/t/idx20804-unable-to-retrieve-document-from-not-working-on-deployed-application-working-on-localhost/24081>\
**Category:** OAuth/OIDC\
**Created:** [April 26, 2023, 12:17pm UTC](https://devforum.okta.com/t/idx20804-unable-to-retrieve-document-from-not-working-on-deployed-application-working-on-localhost/24081 "2023-04-26T12:17:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devesh](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@Devesh](https://devforum.okta.com/u/Devesh)\
**Post date:** [April 26, 2023, 12:17pm UTC](https://devforum.okta.com/t/idx20804-unable-to-retrieve-document-from-not-working-on-deployed-application-working-on-localhost/24081/1 "2023-04-26T12:17:47Z")

</div>

2023-04-26 14:12:30.251 +02:00 [ERR] An unhandled exception has occurred while executing the request.  
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘https://{domainreplaced }.okta.com/.well-known/openid-configuration’.  
—\> System.IO.IOException: IDX20804: Unable to retrieve document from: ‘https:/{domainreplaced }…okta.com/.well-known/openid-configuration’.  
—\> System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ({domainreplaced }…okta.com:443)  
—\> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.  
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)  
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.TaskCompletionSourceWithCancellation`1.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 Okta.AspNet.Abstractions.OktaHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel) at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel) at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)  
— End of inner exception stack trace —  
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel) at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsyncInternal(AuthenticationProperties properties) at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsync(AuthenticationProperties properties) at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.ChallengeAsync(AuthenticationProperties properties)  
at Microsoft.AspNetCore.Authentication.AuthenticationService.ChallengeAsync(HttpContext context, String scheme, AuthenticationProperties properties)  
at Microsoft.AspNetCore.Mvc.ChallengeResult.ExecuteResultAsync(ActionContext context)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g\_\_Awaited|30\_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g\_\_Awaited|28\_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g\_\_Awaited|25\_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g\_\_Awaited|20\_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g\_\_Awaited|17\_0(ResourceInvoker invoker, Task task, IDisposable scope)  
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g\_\_Awaited|17\_0(ResourceInvoker invoker, Task task, IDisposable scope)  
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g\_\_AwaitRequestTask|6\_0(Endpoint endpoint, Task requestTask, ILogger logger)  
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)  
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)  
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g\_\_Awaited|6\_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [April 26, 2023, 3:31pm UTC](https://devforum.okta.com/t/idx20804-unable-to-retrieve-document-from-not-working-on-deployed-application-working-on-localhost/24081/2 "2023-04-26T15:31:32Z")

</div>

This sounds like a generic issue reaching the well-known endpoint itself from your deployment environment. Is your server able to make any outbound HTTP requests to Okta?

---

<div class="post-metadata">

**Author:** ![Devesh](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@Devesh](https://devforum.okta.com/u/Devesh)\
**Post date:** [May 1, 2023, 9:38am UTC](https://devforum.okta.com/t/idx20804-unable-to-retrieve-document-from-not-working-on-deployed-application-working-on-localhost/24081/3 "2023-05-01T09:38:04Z")

</div>

No it is not server is not connected to the internet so what changes are required

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [May 1, 2023, 3:43pm UTC](https://devforum.okta.com/t/idx20804-unable-to-retrieve-document-from-not-working-on-deployed-application-working-on-localhost/24081/4 "2023-05-01T15:43:52Z")

</div>

So your server does _not_ have access to the internet? How would it be able to authorize users with OAuth then?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 14, 2024, 5:54pm UTC](https://devforum.okta.com/t/idx20804-unable-to-retrieve-document-from-not-working-on-deployed-application-working-on-localhost/24081/5 "2024-02-14T17:54:57Z")

</div>


