
FarazS.66632 (Customer) asked a question.
This is my error:
ArgumentException: IDX20108: The address specified 'https://{yourOktaDomain}/oauth2/default/.well-known/openid-configuration' is not valid as per HTTPS scheme. Please specify an https address for security reasons. If you want to test with http address, set the RequireHttps property on IDocumentRetriever to false. (Parameter 'address')
InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://{yourOktaDomain}/oauth2/default/.well-known/openid-configuration'.
this is my code block
services.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(options =>
{
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.Authority = Configuration["Okta:Domain"] + "/oauth2/default";
options.RequireHttpsMetadata = true;
options.ClientId = Configuration["Okta:ClientId"];
options.ClientSecret = Configuration["Okta:ClientSecret"];
options.ResponseType = OpenIdConnectResponseType.Code;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("openid");
options.Scope.Add("profile");
options.SaveTokens = true;
options.TokenValidationParameters = new TokenValidationParameters
{
NameClaimType = "name",
RoleClaimType = "groups",
ValidateIssuer = true
};
});
services.AddAuthorization();
"Okta": {
"ClientId": "0oasddmtdl6yF2Z0gg44x6",
"ClientSecret": "clLGJTc6ez1kRKRW6fPvhfn_2odR8_yp9GuqZDQoh_",
"Domain": "https://dev-4088787390.okta.comDashboard",
"PostLogoutRedirectUri": "https://ljhocalhost:44395/"
}

Looks like your Okta:Domain is malformed, e.g. you specified https://dev-4088787390.okta.comDashboard but probably meant https://dev-4088787390.okta.com