Hi,
I’m trying to run the Custom login sample application. I have configured the code with the details of the Auth0 application created in my tenant. My code is running behind a proxy server and I have configured the proxy server details and have supplied the credentials in code. The call to GetTokenAsync always times out but there is always successful login in Auth0 logs every time. If I were to enter incorrect credentials, I get the incorrect credentials error message.
string auth0Domain = ConfigurationManager.AppSettings["auth0:Domain"];
string auth0ClientId = ConfigurationManager.AppSettings["auth0:ClientId"];
string auth0ClientSecret = ConfigurationManager.AppSettings["auth0:ClientSecret"];
var proxyHandler = new HttpClientHandler
{
Proxy = new WebProxy
{
Credentials = new NetworkCredential(proxyusername, proxypwd),
Address = new Uri("{Proxy URL}")
}
};
AuthenticationApiClient client =
new AuthenticationApiClient(
new Uri($"https://{auth0Domain}/"), new HttpClientAuthenticationConnection(proxyHandler));
var result = await client.GetTokenAsync(new ResourceOwnerTokenRequest
{
ClientId = auth0ClientId,
ClientSecret = auth0ClientSecret,
Scope = "openid profile",
Realm = "Username-Password-Authentication", // Specify the correct name of your DB connection
Username = vm.EmailAddress,
Password = vm.Password
});
I have also set the security protocol to TLS 1.2 in the Startup configuration as some post suggested, but it doesn’t seem to have an impact.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Here is the error message
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 {IP address}:443