Skip to content

Commit

Permalink
Merge pull request SAML-Toolkits#66 from open-craft/edx1-sls-optional
Browse files Browse the repository at this point in the history
Fix creation of metadata with no SLS, when using settings.get_sp_metadata()
  • Loading branch information
pitbulk committed May 8, 2015
2 parents c44971e + b1234fd commit b753ea7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/onelogin/saml2/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=N
organization = {}

sls = ''
if 'singleLogoutService' in sp:
if 'singleLogoutService' in sp and 'url' in sp['singleLogoutService']:
sls = """ <md:SingleLogoutService Binding="%(binding)s"
Location="%(location)s" />\n""" % \
{
Expand Down
2 changes: 1 addition & 1 deletion tests/src/OneLogin/saml2_tests/metadata_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def testBuilder(self):

security['authnRequestsSigned'] = True
security['wantAssertionsSigned'] = True
del sp_data['singleLogoutService']
del sp_data['singleLogoutService']['url']

metadata2 = OneLogin_Saml2_Metadata.builder(
sp_data, security['authnRequestsSigned'],
Expand Down

0 comments on commit b753ea7

Please sign in to comment.