Skip to content

Commit b753ea7

Browse files
committed
Merge pull request #66 from open-craft/edx1-sls-optional
Fix creation of metadata with no SLS, when using settings.get_sp_metadata()
2 parents c44971e + b1234fd commit b753ea7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/onelogin/saml2/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=N
7474
organization = {}
7575

7676
sls = ''
77-
if 'singleLogoutService' in sp:
77+
if 'singleLogoutService' in sp and 'url' in sp['singleLogoutService']:
7878
sls = """ <md:SingleLogoutService Binding="%(binding)s"
7979
Location="%(location)s" />\n""" % \
8080
{

tests/src/OneLogin/saml2_tests/metadata_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def testBuilder(self):
6464

6565
security['authnRequestsSigned'] = True
6666
security['wantAssertionsSigned'] = True
67-
del sp_data['singleLogoutService']
67+
del sp_data['singleLogoutService']['url']
6868

6969
metadata2 = OneLogin_Saml2_Metadata.builder(
7070
sp_data, security['authnRequestsSigned'],

0 commit comments

Comments
 (0)