diff --git a/mellon/views.py b/mellon/views.py index e5d6e5b..7bab9a3 100644 --- a/mellon/views.py +++ b/mellon/views.py @@ -338,9 +338,10 @@ class LoginView(ProfileMixin, LogMixin, View): # configure requested AuthnClassRef authn_classref = utils.get_setting(idp, 'AUTHN_CLASSREF') if authn_classref: + authn_classref = tuple([str(x) for x in authn_classref]) req_authncontext = lasso.Samlp2RequestedAuthnContext() authn_request.requestedAuthnContext = req_authncontext - req_authncontext.authnContextClassRef = tuple(authn_classref) + req_authncontext.authnContextClassRef = authn_classref self.set_next_url(next_url) login.buildAuthnRequestMsg() except lasso.Error, e: diff --git a/tests/test_views.py b/tests/test_views.py index bb42316..42bfd8f 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -198,8 +198,8 @@ def test_sp_initiated_login_chosen(private_settings, client): def test_sp_initiated_login_requested_authn_context(private_settings, client): private_settings.MELLON_IDENTITY_PROVIDERS = [{ 'METADATA': open('tests/metadata.xml').read(), - 'AUTHN_CLASSREF': ['urn:be:fedict:iam:fas:citizen:eid', - 'urn:be:fedict:iam:fas:citizen:token'], + 'AUTHN_CLASSREF': [u'urn:be:fedict:iam:fas:citizen:eid', + u'urn:be:fedict:iam:fas:citizen:token'], }] response = client.get('/login/') assert response.status_code == 302