Exception: Correlation failed. Unknown location

13,228

Solution 1

It was mentioned as per below link that state property was missing.

But still I am not able to figure out how do I set one.

So not marking as accepted answer if someone has final answer.

https://github.com/aspnet/AspNetCore/issues/7501#issuecomment-464082989

Updated:

Below is the answer to this.

https://stackoverflow.com/a/54721271/9263418

Solution 2

As of 2020 you should be using https to resolve this

app.UseHttpsRedirection();

For development environments run dotnet dev-certs https --trust to trust the local certificates

Share:
13,228
Anonymous Creator
Author by

Anonymous Creator

Juggernaut

Updated on June 05, 2022

Comments

  • Anonymous Creator
    Anonymous Creator almost 2 years

    After identityserver authentication when it redirects to my application, it gives

    Exception: Correlation failed. Unknown location

    Now because I am using SPA. This route is definitely not there. But question is how do I define one. And what should I do there.

    I have used hybrid flow of Identityserver.

    https://localhost:44375/signin-oidc

    I have referred following.

    https://github.com/IdentityServer/IdentityServer4.Samples/blob/master/Clients/src/MvcHybridAutomaticRefresh/Startup.cs

    But in above link there is a SPA middleware. which is VueCliMiddleWare. (And to me that is creating issue. routes.)

    (For Rest of the routes it returns index file as per following code. Only this /oidc-client path is not working.)

         app.Use(async (context, next) =>
            {
                await next();
                if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
                {
                    context.Request.Path = "/index.html";
                    await next();
                }
            })
    .UseDefaultFiles(new DefaultFilesOptions { DefaultFileNames = new List<string> { "index.html" } });
    

    If I define following

    routes.MapSpaFallbackRoute(
                        name: "spa - fallback",
                        defaults: new { controller = "CatchAll", action = "Index" });
    

    Then this route redirects to that controller. But there I am not able to return index file.