-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Allow additional trusted hosts during callback redirect #355
Comments
I'm curious why specifying the redirect via |
At present, the view decodes the redirect URI from the This issue requires that we can add more allowed redirect hosts, so we can redirect away to the frontend application that may be at a different host. |
Instead of using Django's setting, I think a dedicated setting in the |
I think using Django's |
I haven’t written Django frontends for probably 5 years, but why would they be hosted on a different URL/port? Is this because of use of e.g. DRF and single page frontends? If so, the frontend should fetch tokens using PKCE flow, and send the token as a header to the backend. |
Originally I had Remix frontend handle SSO and then forward the ADFS JWT with every API call using the provided So now we are looking to piggyback off the existing Django session cookie since it's accessible by both the backend and frontend.
It's just that during local development, it runs on a different port at
For now we are logging into Django to set the session cookie, and then manually going back to the Remix app. Works a treat. As for third-party's using the Django API - they go through an API gateway which handles their Oauth2 token exchanging, etc. |
I see. I'm a bit unsure of the security implications of merging a SPA into Since this is a dev-problem, an alternative could be to allow any configured host when DEBUG is on? I'd prefer not to introduce extra settings and pit falls to production environments. Most security incidents are due to configuration issues. |
I was imagining this being useful for a services based approach where you authenticate against I'm not sure about the security implications of that. I would imagine if you're in charge of both hosts, it should be fine. I don't see these concerns as possible if that's the case:
Additionally, it looks like |
During development, our Django backend runs at
http://localhost:8000/
while the frontend is athttp://localhost:5173/
.The following host verification code restricts the redirect to the current request's host.
django-auth-adfs/django_auth_adfs/views.py
Lines 54 to 59 in 9415d8a
Could it be possible to merge in Django's ALLOWED_HOSTS setting so we can redirect them back to the original client that may be at a different host?
Upvote & Fund
The text was updated successfully, but these errors were encountered: