Hello everyone,
We’re implementing an OAuth login flow (with Microsoft) and facing a challenge with the SameSite attribute for our session cookies. Our preferred security setting is SameSite=Strict, but this causes issues post-authentication: users aren’t properly redirected back to our site, as the strict policy prevents our session cookies from being set upon return from Microsoft’s authentication page.
Switching to SameSite=Lax resolves this redirection issue, but we’re concerned about the security implications. We want to ensure top security without compromising the OAuth functionality.
Questions:
1. Is SameSite=Lax the only practical solution in such OAuth scenarios, or are there secure workarounds that allow us to keep SameSite=Strict?
2. If Lax is necessary, what additional security measures should we consider to mitigate any risks introduced by not using Strict?
We’re looking for insights or best practices on balancing security with functional OAuth flows.
Thanks in advance!