Skip to content

Commit

Permalink
Add SAML_DESTINATION_HTTPS setting
Browse files Browse the repository at this point in the history
  • Loading branch information
DHerls committed Dec 3, 2019
1 parent 14e6b44 commit 39583af
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ SAML_IDP_URL = 'https://example.com/saml/metadata/'
| SAML_ATTR_MAP | List of 2-tuples to map SAML attributes to Django user attributes | [] | [('givenName', 'first_name')] |
| SAML_BASE_DIRECTORY | File path to load SP certificates. **Must contain a 'certs' folder with 'sp.key' and 'sp.crt' inside.** | None | `os.path.join(BASE_DIR, 'saml')` |
| SAML_DESTINATION_HOST | Static value to compare with the SAML Destination attribute instead of reading from the request. Useful for load balancers. | None | 'example.com'
| SAML_DESTINATION_HTTPS | Companion for SAML_DESTINATION_HOST. Set to True if the destination will be over HTTPS but the final request will not be. | None | True

**SAML_SECURITY** Default and Example
```python
Expand Down
1 change: 1 addition & 0 deletions django_saml/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@
SAML_BASE_DIRECTORY = None

SAML_DESTINATION_HOST = None
SAML_DESTINATION_HTTPS = None
2 changes: 2 additions & 0 deletions django_saml/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def prepare_django_request(request):
}
if settings.SAML_DESTINATION_HOST is not None:
result['http_host'] = settings.SAML_DESTINATION_HOST
if settings.SAML_DESTINATION_HTTPS is not None:
result['https'] = settings.SAML_DESTINATION_HTTPS
return result


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="python3-saml-django",
version="1.1.0",
version="1.1.1",
author="THON Technology",
author_email="[email protected]",
description="Implement SAML Single Sign-On in your Django project quickly and easily.",
Expand Down

0 comments on commit 39583af

Please sign in to comment.