Correlation failed intermittently or just loops back to login

Hello all, i was using another thread to report this issue, but since it has been marked as answered by the OP i decided to create a new thread, makes sense.

So i am experiencing this “Correlation failed.” intermittently, but most of the time i just get looped back to the login screen again.

Debuging my App’s code, i see that the login process is completed while the C# events are firing up, i can capture the authentication, but for some reason, it just bounces back to the login screen.

When it bounces back, it calls Authorize again in Auth0, and i have recorded the HAR file for that request here.

https://drive.google.com/open?id=1eMc_WWclA3i_PviVaL3Ld2PYD33jIzyh

It’s 900kb so i had to google drive it :-\

A curious information tho, when i switch on / off the Hosted Page customization, the login completes successfully ONLY ONCE tho.

I am thinking this is some kind of handshake mismatch or some sort of cache, i don’t know.

I tried so many things in my end and to no avail.

My C# code looks like the coding from Auth0 guides, so i am really at odds with this issue.

Thing is, it was working great for the first time i implemented this, then next day, this started happening and i never could fix it.

I used JWT and OpenID approaches and both gives the same error, i am now using OpenID tho.

Can anyone please give me a hand i spent so many many hours on this and i almost giving up Auth0 over this :-\

Thank you!

Hey there @eduardo_ramires, let me see what I can find in this HAR file captures and I will get back to you. Thanks!

Previous referenced thread: "Sign in as User" Feature throws "Correlation failed" exception under ASP.Net Core - #8 by eduardo_ramires

1 Like

Thank you James :slight_smile:

Hi Eduardo. Unfortunately the .HAR is incomplete. Make sure you check the “Preserve log” checkbox, and do so before even going to your application, so that the request from the application (and all the way back to the response) is recorded. Can you give it another try?

Hello Nicolas !! thank you for your assistence, i am sorry for pressing this issue but i really need to get this working.

Let me update you on what happened when i got the new HAR file for you.
I am using Chrome in Incognito mode just so there’s no trash cached on the testing.

When i was attempting to login today, i notice something interesting, remember i said that in my APP the login process fire up all the events and everything and i can even break point it in my code and actually see the authentication process successfully finish?

Well, after the login loops back to the Auth0 Hosted login page, i decided to just type my domain name up and go back to my home screen, then i clicked on the Login link, and BOOM i was logged in.

So i am guessing it’s something about it returning to the Hosped page for some weird reason.

I compiled a full HAR file for you, lets hope this helps.

2.6MB though :frowning:

I think the link is the same i uploaded on top of the last one.
https://drive.google.com/open?id=1eMc_WWclA3i_PviVaL3Ld2PYD33jIzyh

It looks like it’s just a bit something going on here, i am hoping we can figure this out :slight_smile:

Thank you and Happy new year o/

OMG i think i found out the issue here.

In the Starting Guide they have this bit of code:

    public async Task Login(string ReturnUrl = "/")
    {
        await HttpContext.ChallengeAsync("Auth0", new AuthenticationProperties() { RedirectUri = ReturnUrl });
    }

In my APP i just did:

    public async Task Login(string ReturnUrl)
    {
        await HttpContext.ChallengeAsync("Auth0", new AuthenticationProperties() { RedirectUri = ReturnUrl });
    }

All the problem was the ReturnUrl, it needs to have a default value, otherwise it will go back to login page :smile:

In my case, it needs to be like this:

    public async Task Login(string ReturnUrl = "/Home/Areas")
    {
        await HttpContext.ChallengeAsync("Auth0", new AuthenticationProperties() { RedirectUri = ReturnUrl });
    } 

The reason i removed the slash from the original code was because my Site have a specific Area with Authorized content and some others without.

What a nightmare :smile:

Thank you guys for all the help o/

2 Likes

Fantastic @eduardo_ramires, I’m glad it all came together and thanks for sharing the solution!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.