You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -273,6 +274,7 @@ Some of the following settings are related to how this module operates. The rest
273
274
|**WANT\_RESPONSE\_SIGNED** | Set this to `False` if you don't want your provider to sign the response. | `bool` | `True` | |
274
275
|**ACCEPTED\_TIME\_DIFF** | Sets the [accepted time diff](https://pysaml2.readthedocs.io/en/latest/howto/config.html#accepted-time-diff) in seconds | `int` or `None` | `None` | |
275
276
|**ALLOWED\_REDIRECT\_HOSTS** | Allowed hosts to redirect to using the `?next=` parameter | `list` | `[]` | `['https://app.example.com', 'https://api.exmaple.com']` |
277
+
|**DISABLE\_EXCEPTION\_HANDLER** | Set this to `True` if you want to disable the exception handler. Make sure to handle the `SAMLAuthError`s and other exceptions. | `bool` | `False` | |
This library implements an exception handler that returns an error response with a default error template. See the
356
+
section below if you want to implement a custom error template.
357
+
358
+
If you want to disable error handling, set`DISABLE_EXCEPTION_HANDLER` to `True`. In this case the library will raise
359
+
`SAMLAuthError` when an error happens and you might need to implement an exception handler. This might come in handy if
360
+
you are using the library for an API.
361
+
362
+
## Customize Error Messages and Templates
353
363
354
364
The default permission `denied`, `error`and user `welcome` page can be overridden.
355
365
356
366
To override these pages put a template named 'django\_saml2\_auth/error.html', 'django\_saml2\_auth/welcome.html'or'django\_saml2\_auth/denied.html'in your project's template folder.
367
+
> [!Note]
368
+
> If you set`DISABLE_EXCEPTION_HANDLER` to `True`, the custom error pages will not be displayed.
357
369
358
370
If a 'django\_saml2\_auth/welcome.html' template exists, that page will be shown to the user upon login instead of the user being redirected to the previous visited page. This welcome page can contain some first-visit notes and welcome words. The [Django user object](https://docs.djangoproject.com/en/1.9/ref/contrib/auth/#django.contrib.auth.models.User) is available within the template as the `user` template variable.
0 commit comments