mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #326] CSRF for iframe #248
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BobCashStory on GitHub (Feb 6, 2020).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/326
i need to be able to configure CSRF_COOKIE_DOMAIN from django, to allow my main domain like exemple.com .
Then make login in iframe work.
like healtcheck is healtcheck.exemple.com an iframed into main.exemple.com
@cuu508 commented on GitHub (Mar 4, 2020):
I'd like to understand the problem a little better.
A. Is the login form served on a different domain? I.e., you have a centralized login form which takes username and password, and submits it to a Healthchecks instance running somewhere else?
This would try to do exactly what CSRF protection is supposed to prevent. So CSRF protection would have to be switched off. A better solution would be to look into implementing some form of SSO.
B. Or is the login form still served by Healthchecks, but everything is enclosed in an iframe, in order to add a custom header or footer?
With some hacks this can work:
django.middleware.clickjacking.XFrameOptionsMiddlewareCSRF_COOKIE_SAMESITE = NoneSESSION_COOKIE_SAMESITE = NoneBut the user experience would be pretty bad: cannot see the URL in address bar, cannot bookmark pages, cannot link directly to check details pages, potential double vertical scrollbars. If you need custom header/footer it would be better to edit the base template.
@BobCashStory commented on GitHub (Mar 4, 2020):
B. the login form still served by Healthchecks !
But in fact the last update you made with the fix Don't set CSRF cookie on first visit. Signup is exempt from CSRF protection make it work for my side !
I though you fixed it because of my issue, ahah, thanks :)