Search code examples
iframeopenid-connectauth0

Getting Correlation failed exception while signing in the auth0 inside an iframe


I can successfully login with the standalone mvc app without the iframe. But when I put the same app inside an iframe, I'm getting the Exception: Correlation failed exception.

enter image description here

When I tried with postman, I'm getting the following response:

enter image description here

I have also tried with different SameSiteMode configurations but to no avail. Is there any way or workaround to achieve this? Thanks.


Solution

  • I suspect the cookie is not sent by the browser.

    You need to use HTTPS to get it to work together with samesite=none;Secure attributes added to the cookie. Otherwise the cookie will be blocked by the browser.

    You can diagnose why a cookie was not accepted or used by going to the Chrome devtools and:

    1. Open the Browser Developer Tools (F12)
    2. Click on the network tab and reload the page
    3. Click on the Cookies request
    4. Select the Cookies tab
    5. Then hover your mouse over the (i) to see the reasoning by the browser

    enter image description here

    To complement this answer, I wrote a blog post that goes into more detail about this topic: Debugging cookie problems