|
5 | 5 | import functools
|
6 | 6 | import json
|
7 | 7 | import logging
|
| 8 | +import warnings as _warnings |
8 | 9 | from base64 import urlsafe_b64encode
|
9 | 10 | from urllib.parse import urlparse
|
10 | 11 |
|
| 12 | +from saml2 import BINDING_HTTP_REDIRECT |
11 | 13 | from saml2.client_base import Base
|
12 | 14 | from saml2.config import SPConfig
|
13 | 15 | from saml2.extension.ui import NAMESPACE as UI_NAMESPACE
|
@@ -429,6 +431,20 @@ def register_endpoints(self):
|
429 | 431 | for endp, binding in sp_endpoints["assertion_consumer_service"]:
|
430 | 432 | parsed_endp = urlparse(endp)
|
431 | 433 | url_map.append(("^%s$" % parsed_endp.path[1:], functools.partial(self.authn_response, binding=binding)))
|
| 434 | + if binding == BINDING_HTTP_REDIRECT: |
| 435 | + msg = " ".join( |
| 436 | + [ |
| 437 | + "AssertionConsumerService endpoint with binding", |
| 438 | + BINDING_HTTP_REDIRECT, |
| 439 | + "is not recommended.", |
| 440 | + "Quoting section 4.1.2 of", |
| 441 | + "'Profiles for the OASIS Security Assertion Markup Language (SAML) V2.0':", |
| 442 | + "The HTTP Redirect binding MUST NOT be used,", |
| 443 | + "as the response will typically exceed the URL length", |
| 444 | + "permitted by most user agents.", |
| 445 | + ] |
| 446 | + ) |
| 447 | + _warnings.warn(msg, DeprecationWarning) |
432 | 448 |
|
433 | 449 | if self.discosrv:
|
434 | 450 | for endp, binding in sp_endpoints["discovery_response"]:
|
|
0 commit comments