ASP.NET Core - correlation failed error message


#1

I just started using Okta in a new ASP.NET Core application yesterday. It was working fine, but I must have changed something, because now I’m getting a “Correlation failed” error when trying to test it.

I’m following the ASP.NET Core tutorial exactly:

public void ConfigureServices(IServiceCollection services)
{
    services.AddTransient<IFoo, Foo>();


   // ... etc ...

    services.AddAuthentication(options =>
        {
            options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            options.DefaultChallengeScheme = OktaDefaults.MvcAuthenticationScheme;
        })
        .AddCookie()
        .AddOktaMvc(new OktaMvcOptions
        {
            OktaDomain = "https://dev-XXXXXX.oktapreview.com",
            ClientId = "YYYYYYYYYY",
            ClientSecret = "ZZZZZZZZZZZ"
        });

    services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
// ... snip ...

    app.UseAuthentication();

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default",
            template: "{controller=Home}/{action=Index}/{id?}");
    });
}

And here are my Application general settings:

I put an [Authorize] attribute on an action. I go to that action, I get redirected to Okta, I login, and here’s the error message I get after getting redirected back:

Any ideas what I might be doing wrong?