Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Somehow deleted the get_location method?
  • Loading branch information
Reece authored and Reece committed Apr 12, 2017
commit 2868b317dfacbac4a335b952975dff7e5d806454
11 changes: 11 additions & 0 deletions djangosaml2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,14 @@ def get_idp_sso_supported_bindings(idp_entity_id=None):
return meta.service(idp_entity_id, 'idpsso_descriptor', 'single_sign_on_service').keys()
except UnknownSystemEntity:
return []


def get_location(http_info):
"""Extract the redirect URL from a pysaml2 http_info object"""
assert 'headers' in http_info
headers = http_info['headers']

assert len(headers) == 1
header_name, header_value = headers[0]
assert header_name == 'Location'
return header_value