def _authn_context(self, authn_context_class=None): if authn_context_class is None: authn_context_class = self.saml2_authn_context_class if authn_context_class != "do not specify": return samlp.requested_authn_context_from_string( self._authn_context_template.format(context_class=authn_context_class) )
def _authn_context(self, authn_context_class=None): if authn_context_class is None: authn_context_class = self.saml2_authn_context_class if authn_context_class != 'do not specify': return samlp.requested_authn_context_from_string( self._authn_context_template.format( context_class=authn_context_class))
def testUsingTestData(self): """Test for requested_authn_context_from_string() using test data""" new_context = samlp.requested_authn_context_from_string( samlp_data.TEST_REQUESTED_AUTHN_CONTEXT) assert isinstance(new_context.authn_context_class_ref[0], saml.AuthnContextClassRef) assert isinstance(new_context.authn_context_decl_ref[0], saml.AuthnContextDeclRef) assert new_context.comparison == "exact"
def testAccessors(self): """Test for RequestedAuthnContext accessors""" self.context.authn_context_class_ref.append(saml.AuthnContextClassRef()) self.context.authn_context_decl_ref.append(saml.AuthnContextDeclRef()) self.context.comparison = "exact" new_context = samlp.requested_authn_context_from_string( self.context.to_string()) assert isinstance(new_context.authn_context_class_ref[0], saml.AuthnContextClassRef) assert isinstance(new_context.authn_context_decl_ref[0], saml.AuthnContextDeclRef) assert new_context.comparison == "exact"