Skip to content

Commit e4c8f37

Browse files
committed
Improve AuthNRequest format
1 parent f7e59c3 commit e4c8f37

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/onelogin/saml2/authn_request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ def __init__(self, settings, force_authn=False, is_passive=False, set_nameid_pol
6161

6262
display_name = 'displayname' in organization_data[lang] and organization_data[lang]['displayname']
6363
if display_name:
64-
provider_name_str = 'ProviderName="%s"' % organization_data[lang]['displayname']
64+
provider_name_str = "\n" + ' ProviderName="%s"' % organization_data[lang]['displayname']
6565

6666
force_authn_str = ''
6767
if force_authn is True:
68-
force_authn_str = 'ForceAuthn="true"'
68+
force_authn_str = "\n" + ' ForceAuthn="true"'
6969

7070
is_passive_str = ''
7171
if is_passive is True:
72-
is_passive_str = 'IsPassive="true"'
72+
is_passive_str = "\n" + ' IsPassive="true"'
7373

7474
nameid_policy_str = ''
7575
if set_nameid_policy:

src/onelogin/saml2/xml_templates.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ class OneLogin_Saml2_Templates(object):
2424
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
2525
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
2626
ID="%(id)s"
27-
Version="2.0"
28-
%(provider_name)s
29-
%(force_authn_str)s
30-
%(is_passive_str)s
27+
Version="2.0"%(provider_name)s%(force_authn_str)s%(is_passive_str)s
3128
IssueInstant="%(issue_instant)s"
3229
Destination="%(destination)s"
3330
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"

0 commit comments

Comments
 (0)