diff options
author | Rob Crittenden <rcritten@redhat.com> | 2015-03-19 15:20:28 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-03-24 09:42:24 -0400 |
commit | 0f56ef9942ee631a9306806bea8f3bb8e7b81076 (patch) | |
tree | 8cf07962da831a3238ebdee7f7c94eb08e9daae5 /tests/helpers/http.py | |
parent | 424a03e5bd141bfa80220816d6e9bd6be9aa256f (diff) | |
download | ipsilon.git-0f56ef9942ee631a9306806bea8f3bb8e7b81076.tar.gz ipsilon.git-0f56ef9942ee631a9306806bea8f3bb8e7b81076.tar.xz ipsilon.git-0f56ef9942ee631a9306806bea8f3bb8e7b81076.zip |
Add tests for Name ID functionality
Some Name ID formats are not implemented so are expected to fail.
Kerberos is implemented but the test is done using form authentication
so no Kerberos principal is available so authentication is denied.
https://fedorahosted.org/ipsilon/ticket/27
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'tests/helpers/http.py')
-rwxr-xr-x | tests/helpers/http.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/helpers/http.py b/tests/helpers/http.py index cf59853..d8c56b3 100755 --- a/tests/helpers/http.py +++ b/tests/helpers/http.py @@ -266,6 +266,22 @@ class HttpSessions(object): page.expected_value('//div[@class="alert alert-success"]/p/text()', 'SP Successfully added') + def set_sp_default_nameids(self, idp, sp, nameids): + """ + nameids is a list of Name ID formats to enable + """ + idpsrv = self.servers[idp] + idpuri = idpsrv['baseuri'] + url = '%s/%s/admin/providers/saml2/admin/sp/%s' % (idpuri, idp, sp) + headers = {'referer': url} + headers['content-type'] = 'application/x-www-form-urlencoded' + payload = {'submit': 'Submit', + 'allowed_nameids': ', '.join(nameids)} + r = idpsrv['session'].post(url, headers=headers, + data=payload) + if r.status_code != 200: + raise ValueError('Failed to post SP data [%s]' % repr(r)) + def fetch_rest_page(self, idpname, uri): """ idpname - the name of the IDP to fetch the page from |