My dev environment, the auth server has an invalid SSL cert. When my client tried to get the OpenId config from https://auth-server/.well-known/openid-configuration
I get the following error:
WinHttpException: A security error occurred
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
HttpRequestException: An error occurred while sending the request.
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
IOException: IDX10804: Unable to retrieve document from: 'https://auth-server/.well-known/openid-configuration'.
Microsoft.IdentityModel.Protocols.HttpDocumentRetriever+<GetDocumentAsync>d__8.MoveNext()
InvalidOperationException: IDX10803: Unable to obtain configuration from: 'https://auth-server/.well-known/openid-configuration'.
Here is how I configure IdentityServer4:
services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme)
.AddIdentityServerAuthentication(options =>
{
options.Authority = authority;
options.SupportedTokens = SupportedTokens.Jwt;
options.ApiSecret = secret;
//change this to true for SSL
options.RequireHttpsMetadata = false;
});
Is there any way to disable cert validation in this scenario?