I am working on a .Net 8 core MVC application, where we are implementing Okta authentication. Post successful okta authentication the control comes back to the ‘challenge’ method when I don’t use a redirectUri, as expected.
But when I need Okta to post back to a different controller method post authentication, I am getting the below error.
So, basically below line runs fine without issues
…
if (!this.HttpContext.User.Identity.IsAuthenticated)
{
return Challenge(OpenIdConnectAuthenticationDefaults.AuthenticationType);
…
But this line fails…
return Challenge(new AuthenticationProperties { RedirectUri=ConfigUtils.GetConfigValue(“Okta:RedirectUri”)}, OpenIdConnectAuthenticationDefaults.AuthenticationType);
Any insight into this will be very helpful.
Thanks
I am the original author of the post and since I am unable to edit the post after 4 modifications, as requested by Okta services teams, I am adding the repro steps with code snippets