diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2017-07-26 04:34:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-26 04:34:52 -0700 |
commit | 8ca067dce4dea1fb5dd4035e4f1036a47e984a17 (patch) | |
tree | e41e37fca93ce47827a190f8479387b4915ab0d2 /src | |
parent | 47cbd128516d5994591e9ae8d3068bf43196f018 (diff) | |
parent | 6d2200808b618f0fc8b163d7e03e16c2827c4eeb (diff) | |
download | pysaml2-8ca067dce4dea1fb5dd4035e4f1036a47e984a17.tar.gz |
Merge branch 'master' into feature-hide-assertion-consumer-service
Diffstat (limited to 'src')
-rw-r--r-- | src/saml2/client_base.py | 8 | ||||
-rw-r--r-- | src/saml2/config.py | 2 | ||||
-rw-r--r-- | src/saml2/mdstore.py | 4 | ||||
-rw-r--r-- | src/saml2/response.py | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/src/saml2/client_base.py b/src/saml2/client_base.py index 2a5d45cf..50b457d1 100644 --- a/src/saml2/client_base.py +++ b/src/saml2/client_base.py @@ -339,6 +339,14 @@ class Base(Entity): except KeyError: nsprefix = None + try: + force_authn = kwargs['force_authn'] + except KeyError: + force_authn = self.config.getattr('force_authn', 'sp') + finally: + if force_authn: + args['force_authn'] = 'true' + if kwargs: _args, extensions = self._filter_args(AuthnRequest(), extensions, **kwargs) diff --git a/src/saml2/config.py b/src/saml2/config.py index 235bf91e..e508a954 100644 --- a/src/saml2/config.py +++ b/src/saml2/config.py @@ -77,6 +77,7 @@ SP_ARGS = [ "logout_requests_signed", "requested_attribute_name_format", "hide_assertion_consumer_service", + "force_authn", ] AA_IDP_ARGS = [ @@ -208,7 +209,6 @@ class Config(object): self.crypto_backend = 'xmlsec1' self.scope = "" self.allow_unknown_attributes = False - self.allow_unsolicited = False self.extension_schema = {} self.cert_handler_extra_class = None self.verify_encrypt_cert_advice = None diff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py index eff75c8b..72825ea8 100644 --- a/src/saml2/mdstore.py +++ b/src/saml2/mdstore.py @@ -750,7 +750,7 @@ class MetaDataExtern(InMemoryMetaData): """ response = self.http.send(self.url) if response.status_code == 200: - _txt = response.text.encode("utf-8") + _txt = response.content return self.parse_and_check_signature(_txt) else: logger.info("Response status: %s", response.status_code) @@ -814,7 +814,7 @@ class MetaDataMDX(InMemoryMetaData): response = requests.get(mdx_url, headers={ 'Accept': SAML_METADATA_CONTENT_TYPE}) if response.status_code == 200: - _txt = response.text.encode("utf-8") + _txt = response.content if self.parse_and_check_signature(_txt): return self.entity[item] diff --git a/src/saml2/response.py b/src/saml2/response.py index 13323509..5ca75bf1 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -666,7 +666,7 @@ class AuthnResponse(StatusResponse): _attr_statem = _assertion.attribute_statement[0] ava.update(self.read_attribute_statement(_attr_statem)) if not ava: - logger.error("Missing Attribute Statement") + logger.debug("Assertion contains no attribute statements") return ava def _bearer_confirmed(self, data): |