示例#1
0
 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)
         )
示例#2
0
 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))
示例#3
0
    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"
示例#4
0
    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"
示例#5
0
    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"
示例#6
0
    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"