-
I have a handler that saves a "user" prop to the session through SessionManageLayer.
On successful authentication I redirect the user back to the In order to pull out the user session data I have a
After I've set the "user" property on the session through If I just change the URL in my browser to go directly to the Is there something I have to return in the redirect to make sure that headers or a cookie is set correctly after the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I've seen the other answer about setting CORS up, but this is just on a straight GET call, there's no JS involved. It's just an OAuth flow:
|
Beta Was this translation helpful? Give feedback.
-
Right, so the issue is that the SET_COOKIE header isn't set on the redirect. Which I can explicitly return |
Beta Was this translation helpful? Give feedback.
-
Right, so I've figured this out, for anyone else bashing their heads. Basically, it's because of the internal redirect after a redirect from a third-party site. My OAuth flow routes a user out to an Azure SSO login page, once they log in there, they're redirected to Because it's a redirect, the referrer for the redirect to the So changing the SessionManagerLayer to use |
Beta Was this translation helpful? Give feedback.
Right, so I've figured this out, for anyone else bashing their heads.
Basically, it's because of the internal redirect after a redirect from a third-party site. My OAuth flow routes a user out to an Azure SSO login page, once they log in there, they're redirected to
/auth/authorized
which sets up their session data, then redirects to the index page of the site/
.Because it's a redirect, the referrer for the redirect to the
/
page is actually still the MS Azure login page, rather than the sites own page. This means the browser won't send the cookie back to the server because the referrer doesn't match up in strict mode.So changing the SessionManagerLayer to use
with_same_site(SameSite::Lax)