Skip to content

Commit f527bc1

Browse files
committed
Add parameter to the demos
1 parent 0791176 commit f527bc1

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

demo-bottle/index.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ def init_saml_auth(req):
3030
def prepare_bottle_request(req):
3131
url_data = urlparse(req.url)
3232
return {
33+
'https': 'on' if req.urlparts.scheme == 'https' else 'off',
3334
'http_host': req.get_header('host'),
3435
'server_port': url_data.port,
3536
'script_name': req.fullpath,
3637
'get_data': req.query,
3738
'post_data': req.forms,
3839
'query_string': req.query_string,
39-
'https': 'on' if req.urlparts.scheme == 'https' else 'off'
40+
# Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144
41+
# 'lowercase_urlencoding': True
4042
}
4143

4244

demo-django/demo/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def prepare_django_request(request):
2424
'server_port': request.META['SERVER_PORT'],
2525
'get_data': request.GET.copy(),
2626
'post_data': request.POST.copy(),
27+
# Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144
28+
# 'lowercase_urlencoding': True,
2729
'query_string': request.META['QUERY_STRING']
2830
}
2931
return result

demo-flask/index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def prepare_flask_request(request):
2929
'script_name': request.path,
3030
'get_data': request.args.copy(),
3131
'post_data': request.form.copy(),
32+
# Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144
33+
# 'lowercase_urlencoding': True,
3234
'query_string': request.query_string
3335
}
3436

src/onelogin/saml2/logout_request.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def is_valid(self, request_data):
261261
:rtype: boolean
262262
"""
263263
self.__error = None
264+
lowercase_urlencoding = False
264265
try:
265266
dom = fromstring(self.__logout_request)
266267

@@ -274,8 +275,6 @@ def is_valid(self, request_data):
274275

275276
if 'lowercase_urlencoding' in request_data.keys():
276277
lowercase_urlencoding = request_data['lowercase_urlencoding']
277-
else:
278-
lowercase_urlencoding = False
279278

280279
if self.__settings.is_strict():
281280
res = OneLogin_Saml2_Utils.validate_xml(dom, 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active())

src/onelogin/saml2/logout_response.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,14 @@ def is_valid(self, request_data, request_id=None):
7777
:rtype: boolean
7878
"""
7979
self.__error = None
80+
lowercase_urlencoding = False
8081
try:
8182
idp_data = self.__settings.get_idp_data()
8283
idp_entity_id = idp_data['entityId']
8384
get_data = request_data['get_data']
8485

8586
if 'lowercase_urlencoding' in request_data.keys():
8687
lowercase_urlencoding = request_data['lowercase_urlencoding']
87-
else:
88-
lowercase_urlencoding = False
8988

9089
if self.__settings.is_strict():
9190
res = OneLogin_Saml2_Utils.validate_xml(self.document, 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active())

0 commit comments

Comments
 (0)