authentication_service.middleware module¶
-
class
authentication_service.middleware.
OIDCSessionManagementMiddleware
(get_response=None)[source]¶ Bases:
django.utils.deprecation.MiddlewareMixin
Middleware to ensure the user session is flushed when the user is directed off domain. At this stage only OIDC redirects off domain.
This is to guard against users logging out of a client site, but their session still being retained on the auth service. This leads to the previous user being immediately logged in without a login prompt.
NOTE: This Middleware should always be as near the end of the Middleware list in settings. Middleware is evaluated in order and this needs to happen as near the end as possible. As other Middleware may also trigger redirects.