Skip to content

Commit 1016cdd

Browse files
authored
Updates for SAML_ALLOWED_HOSTS changes
Update the readme to include documentation regarding how SAML_ALLOWED_HOSTS works and is used.
1 parent 23f55b1 commit 1016cdd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ If you want to allow several authentication mechanisms in your project
113113
you should set the LOGIN_URL option to another view and put a link in such
114114
view to the ``/saml2/login/`` view.
115115

116+
Handling Post-Login Redirects
117+
-----------------------------
118+
It is often desireable for the client to maintain the URL state (or at least manage it) so that
119+
the URL once authentication has completed is consistent with the desired application state (such
120+
as retaining query parameters, etc.) By default, the HttpRequest objects get_host() method is used
121+
to determine the hostname of the server, and redirect URL's are allowed so long as the destination
122+
host matches the output of get_host(). However, in some cases it becomes desireable for additional
123+
hostnames to be used for the post-login redirect. In such cases, the setting::
124+
125+
SAML_ALLOWED_HOSTS = []
126+
127+
May be set to a list of allowed post-login redirect hostnames (note, the URL components beyond the hostname
128+
may be specified by the client - typically with the ?next= parameter.)
129+
130+
In the absence of a ?next= parameter, the LOGIN_REDIRECT_URL setting will be used (assuming the destination hostname
131+
either matches the output of get_host() or is included in the SAML_ALLOWED_HOSTS setting)
132+
133+
116134
Preferred Logout binding
117135
------------------------
118136
Use the following setting to choose your preferred binding for SP initiated logout requests::

0 commit comments

Comments
 (0)