@@ -122,11 +122,11 @@ view to djangosaml2 wb path, like ``/saml2/login/``.
122
122
Handling Post-Login Redirects
123
123
=============================
124
124
125
- It is often desireable for the client to maintain the URL state (or at least manage it) so that
125
+ It is often desirable for the client to maintain the URL state (or at least manage it) so that
126
126
the URL once authentication has completed is consistent with the desired application state (such
127
127
as retaining query parameters, etc.) By default, the HttpRequest objects get_host() method is used
128
128
to determine the hostname of the server, and redirect URL's are allowed so long as the destination
129
- host matches the output of get_host(). However, in some cases it becomes desireable for additional
129
+ host matches the output of get_host(). However, in some cases it becomes desirable for additional
130
130
hostnames to be used for the post-login redirect. In such cases, the setting::
131
131
132
132
SAML_ALLOWED_HOSTS = []
@@ -138,6 +138,22 @@ In the absence of a ``?next=parameter``, the ``ACS_DEFAULT_REDIRECT_URL`` or ``L
138
138
be used (assuming the destination hostname either matches the output of get_host() or is included in the
139
139
``SAML_ALLOWED_HOSTS `` setting)
140
140
141
+ Redirect URL validation
142
+ =======================
143
+
144
+ Djangosaml2 will validate the redirect URL before redirecting to its value. In
145
+ some edge-cases, valid redirect targets will fail to pass this check. This is
146
+ limited to URLs that are a single 'word' without slashes. (For example, 'home'
147
+ but also 'page-with-dashes').
148
+
149
+ In this situation, the best solution would be to add a slash to the URL. For
150
+ example: 'home' could be '/home' or 'home/'.
151
+ If this is unfeasible, this strict validation can be turned off by setting
152
+ ``SAML_STRICT_URL_VALIDATION `` to ``False `` in settings.py.
153
+
154
+ During validation, `Django named URL patterns<https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns> `_
155
+ will also be resolved. Turning off strict validation will prevent this from happening.
156
+
141
157
Preferred sso binding
142
158
=====================
143
159
0 commit comments