Skip to content

FromRequestParts not getting session after save #217

Answered by jdu
jdu asked this question in Q&A
Discussion options

You must be logged in to vote

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)

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jdu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jdu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant