Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross domain iframe support for modern browsers #317

Merged
merged 5 commits into from
Jan 31, 2022

Conversation

adamjmcgrath
Copy link
Contributor

Description

Fixing crossdomain iframe login/logout and attemptSilentAuth support. This can be enabled by using session.cookie.sameSite = 'None' and session.cookie.secure = true (you should run localhost on https for this see: https://auth0.com/docs/libraries/secure-local-development)

References

fixes #315

Testing

To test login/logout from a cross domain iframe:

  1. Run an https reverse proxy like caddy, eg caddy reverse-proxy --from localhost:443 --to localhost:3000
  2. Run the iframe testing example with baseUrl set to https://localhost
  3. Visit http://localhost:3000/iframe (running same app on a different domain to the iframe, which is on https://localhost)
  4. Login and verify that the auth_verification transaction cookies have been removed
  5. Logout and verify that the appSession cookie has been removed

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jan 26, 2022

This pull request introduces 1 alert when merging bc2902c into 73d50df - view on LGTM.com

new alerts:

  • 1 for Missing rate limiting

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jan 27, 2022

This pull request introduces 1 alert when merging 8aab1e0 into c1b1b0c - view on LGTM.com

new alerts:

  • 1 for Missing rate limiting

@adamjmcgrath adamjmcgrath added the review:medium Medium review label Jan 27, 2022
@@ -213,7 +214,8 @@ module.exports = (config) => {
) {
const hasPrevSession = !!req[COOKIES][sessionName];
const replacingPrevSession = !!req[REGENERATED_SESSION_ID];
const hasCurrentSession = req[sessionName] && Object.keys(req[sessionName]).length;
const hasCurrentSession =
Copy link
Contributor Author

@adamjmcgrath adamjmcgrath Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These whitespace changes are from a previous prettier update

@adamjmcgrath adamjmcgrath requested a review from panva January 28, 2022 10:22
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jan 28, 2022

This pull request introduces 1 alert when merging 523a5e9 into c1b1b0c - view on LGTM.com

new alerts:

  • 1 for Missing rate limiting

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jan 28, 2022

This pull request introduces 1 alert when merging da84e1e into 48526b1 - view on LGTM.com

new alerts:

  • 1 for Missing rate limiting

@adamjmcgrath adamjmcgrath merged commit b850bfd into master Jan 31, 2022
@adamjmcgrath adamjmcgrath deleted the iframe-skip-silent-login branch January 31, 2022 10:34
@adamjmcgrath adamjmcgrath mentioned this pull request Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:medium Medium review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SameSite cookie config not respected by skipSilentLogin cookie
2 participants