I’m implementing Auth0 ROPC in a .NET 4.5.2 ASP.NET WebForms application. There is no Startup.cs or OWIN involved. I send in my credentials to the AuthenticationAPI client provided in the [Auth0 .NET SDK][1].
var result = await AuthenticationApiClient.GetTokenAsync(new ResourceOwnerTokenRequest
{
ClientId = ClientId,
ClientSecret = ClientSecret,
Scope = Scope,
Realm = Realm,
Username = <Username>,
Password = <Password>
});
I am able to get a response locally, but when deployed in a Windows 2016 server authentication fails with the following message:
Message: IDX20804: Unable to retrieve document from: ‘https://mytenantname:443/.well-known/openid-configuration’., StackTrace: at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.d__22.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.d__3.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.d__12.MoveNext()
I have the TLS1.2 set in place in the code. I have also setup the proxy to access Auth0. The configuration Url https://mytenantname:443/.well-known/openid-configuration
in fact returns the JSON configuration when accessed in a browser in the server, with traffic routed via the proxy. I also have user management activities using Auth0 like user creation and update which work as expected from the site hosted in the server [1]: https://auth0.github.io/auth0.net/dholki