
00urncm0fGsdNobYk356m1.56139295220643E12 (Customer) asked a question.
I am trying to use Microsoft Identity Server to integrate with Okta in dotnet core 6.0 project. I followed a sample code to add Okta as external identity provider.
builder.Services.AddAuthentication()
.AddOpenIdConnect("okta", "Okta", options =>
{
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.SignOutScheme = IdentityServerConstants.SignoutScheme;
options.Authority = $"https://{OktaDomain}/oauth2/default";
options.ClientId = ClientId;
options.ClientSecret = ClientSecret;
options.ResponseType = "code";
options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("email");
options.SaveTokens = true;
options.TokenValidationParameters = new TokenValidationParameters
{
NameClaimType = "name",
RoleClaimType = "role"
};
});
However, on code execution I received the following error.
2024-06-19 16:54:54.139 -04:00 [ERR] ErrorException "IDX20803: Unable to obtain configuration from: 'https://https://dev-945062.okta.com/oauth2/default/.well-known/openid-configuration'. Will retry at '6/19/2024 8:55:04 PM +00:00'. Exception: 'System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
---> System.Net.Http.HttpRequestException: No such host is known. (https:443)
I am looking for guidance to help me troubleshoot this error.
Best regards,
Muhammad Piracha.

Hi @00urncm0fGsdNobYk356m1.56139295220643E12 (Customer) , thank you for contacting Okta Community!
I've reviewed our documentation for something relevant. It looks like your question is more appropriate for our dedicated Okta Developer Forum.
I advise reaching out via https://devforum.okta.com as they will have more insight into this topic.
In the meantime, you can reference this similar post from Okta Developer:
InvalidOperationException: IDX20803
While we'll do our best to answer your questions here, this medium is more inclined towards Okta's core products and features (non-developer work).
Regards.
--
Help others in the community by liking or hitting Select as Best if this response helped you.