I am working to setup okta for our government client and I am doing a proof of concept. I think I have everything configured correctly but after a user is authenticated I don’t get redirected to the homepage instead it takes me to instance of okta for that user. We are using the .net framework 4.6.2 and visual studio 2019. Here is my web.config values and startup.cs…
<add key="okta:ClientId" value="0oa9uai725mubs89Q5d7" />
<!-- Client Secret -->
<add key="okta:ClientSecret" value="cvKxgAmNX6KNDpu0haxnvsmAvbanv309p6J2M6V-" />
<!-- Org URL -->
<add key="okta:OktaDomain" value="https://dev-82620787.okta.com" />
<!-- Login redirect URI -->
<add key="okta:RedirectUri" value="http://localhost:58555/authorization-code/callback" />
<!-- Logout redirect URI -->
<add key="okta:PostLogoutRedirectUri" value="http://localhost:58555/Home/LogOut" />
public void Configuration(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOktaMvc(new OktaMvcOptions()
{
OktaDomain = ConfigurationManager.AppSettings["okta:OktaDomain"],
ClientId = ConfigurationManager.AppSettings["okta:OktaDomain"],
ClientSecret = ConfigurationManager.AppSettings["okta:ClientSecret"],
RedirectUri = ConfigurationManager.AppSettings["okta:RedirectUri"],
PostLogoutRedirectUri = ConfigurationManager.AppSettings["okta: PostLogoutRedirectUri"],
GetClaimsFromUserInfoEndpoint = true,
Scope = new List<string> { "openid", "profile", "email"}
});
}
}