imsweb / django-saml-sp

A Django application for running one or more SAML service providers (SP)
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

support environment variables to override some values in idp.prepare_… #20

Closed cs4p closed 1 year ago

cs4p commented 2 years ago

This addresses Issue #19. When running behind a proxy server a mismatch occurs between the acs URL submitted to the idp and the URL reported by Django when calling the OneLogin_Saml2_Utils.get_self_url_no_query function. The acs URL will, by necessity, reflect the public URL (e.g. https://app.domain.com) but the OneLogin_Saml2_Utils.get_self_url_no_query function returns the internal URL (e.g. http://loclahost:8000). This pull request allows the application to override the values determined during the prepare_request method with environment values IF needed. The new code has no effect unless the specific environment variables are defined in settings.py, so the merge is safe for any working applications.

dcwatson commented 1 year ago

This is customizable as of 0.6