Commit Graph

8 Commits

Author SHA1 Message Date
Benjamin Dauvergne 688067f270 middleware: improve condition to automatically determine a common domain (fixes #15548)
It works if:
- HTTP Host is a domain name and not an IP address (IPv6 address will not pass
  this test, they lack dots),
- domain contains at least three components.
2017-09-27 21:59:48 +02:00
Frédéric Péters 7767bc6740 use django facilities to get hostname from request (#16525)
This is required as SERVER_NAME may not be used in some uwsgi
configuration, and HTTP_HOST should be used instead.

| Nginx maps the $server_name variable to the first server_name you define.
| In your case you have two solutions: read HTTP_HOST instead of SERVER_NAME
| in your app or set SERVER_NAME to $http_host in uwsgi_params
  -- http://lists.unbit.it/pipermail/uwsgi/2010-August/000571.html

The HttpRequest.get_host method handles those cases and more.
2017-08-10 11:35:21 +02:00
Benjamin Dauvergne 4a52cfee3e allow views to refuse passive login (fixes #13627) 2016-10-18 10:03:41 +02:00
Frédéric Péters 33dded157a middleware: don't fail on unnamed URLs (#11319) 2016-06-13 13:43:06 +02:00
Benjamin Dauvergne 78762accf7 middleware: handle process_view (#9131)
In process_request request.resolver_match is not yet defined.
2015-11-27 12:00:24 +01:00
Benjamin Dauvergne 8da5807298 middleware: do not apply autologin to mellon views (fixes #9131) 2015-11-27 10:29:21 +01:00
Benjamin Dauvergne ad2a575a35 middleware: disallow passive authentication when no IdP is found (fixes #8123) 2015-09-25 16:12:30 +02:00
Benjamin Dauvergne 9667aa5f18 add PassiveAuthenticationMiddleware using a common domain cookie (fixes #8123)
Name of the cookie must be put in MELLON_OPENED_SESSION_COOKIE_NAME and
common domain can be defined in MELLON_OPENED_SESSION_COOKIE_DOMAIN, if
unset the common domain is guessed by removing the first part of the
domain name (www.xxx.com -> xxx.com).
2015-09-25 15:03:49 +02:00