misc: allow unicode strings as authn classref (#10666)

This commit is contained in:
Frédéric Péters 2016-04-15 10:26:25 +02:00
parent 9fe5a00a52
commit 6a6405d75f
2 changed files with 4 additions and 3 deletions

View File

@ -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:

View File

@ -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