Skip to content

Commit 764eb88

Browse files
authored
Merge pull request #111 from timlegge/master
Remove unnecessary parameters
2 parents 1fc2b5f + 2c432f2 commit 764eb88

File tree

6 files changed

+1
-56
lines changed

6 files changed

+1
-56
lines changed

TUTORIAL.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,17 +452,13 @@ The following is from Foswiki's SamlLoginContrib function:
452452
 my $idp = Net::SAML2::IdP->new_from_url(
453453
 url => $this->{Saml}{metadata},
454454
 cacert => $this->{Saml}{cacert},
455-
 sls_force_lcase_url_encoding => $this->{Saml}{sls_force_lcase_url_encoding},
456-
 sls_double_encoded_response => $this->{Saml}{sls_double_encoded_response}
457455
 );
458456
459457
my $redirect = Net::SAML2::Binding::Redirect->new(
460458
url => $idp->slo_url('urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'),
461459
key => $this->{Saml}{sp_signing_key},
462460
cert => $idp->cert('signing'),
463461
param => 'SAMLResponse',
464-
sls_force_lcase_url_encoding => $this->{Saml}{sls_force_lcase_url_encoding},
465-
sls_double_encoded_response => $this->{Saml}{sls_double_encoded_response}
466462
);
467463
468464
my ($response, $relaystate) = $redirect->verify($uri);
@@ -498,7 +494,7 @@ The SP needs to create the Net::SAML2::IdP object as is done above (in this case
498494
);
499495
500496
```
501-
Create the Net::SAML2::Binding::Redirect object. Note the sls_force_lcase_url_encoding is used if the IdP sends a URL that has meen URL encoded with lower case characters %2f instead of %2F.
497+
Create the Net::SAML2::Binding::Redirect object.
502498

503499
```
504500
my $redirect = Net::SAML2::Binding::Redirect->new(
@@ -508,7 +504,6 @@ Create the Net::SAML2::Binding::Redirect object. Note the sls_force_lcase_url_e
508504
param => 'SAMLRequest',
509505
# The ssl_url destination for redirect
510506
url => $idp->sso_url('urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'),
511-
#sls_force_lcase_url_encoding => 1,
512507
);
513508
```
514509
Verify signature on the URL, decode the request and retrieve the XML request and RelayState.

lib/Net/SAML2/Binding/Redirect.pm

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,6 @@ sha1, sha224, sha256, sha384, sha512
7979
8080
Defaults to C<sha1>.
8181
82-
=item B<sls_force_lcase_url_encoding>
83-
84-
Specifies that the IdP requires the encoding of a URL to be in lowercase.
85-
Necessary for a HTTP-Redirect of a LogoutResponse from Azure in particular.
86-
True (1) or False (0). Some web frameworks and underlying http requests assume
87-
that the encoding should be in the standard uppercase (%2F not %2f)
88-
89-
=item B<sls_double_encoded_response>
90-
91-
Specifies that the IdP response sent to the HTTP-Redirect is double encoded.
92-
The double encoding requires it to be decoded prior to processing.
93-
9482
=item B<debug>
9583
9684
Output extra debugging information
@@ -117,20 +105,6 @@ has 'sig_hash' => (
117105
default => 'sha1'
118106
);
119107

120-
has 'sls_force_lcase_url_encoding' => (
121-
isa => 'Bool',
122-
is => 'ro',
123-
required => 0,
124-
default => 0
125-
);
126-
127-
has 'sls_double_encoded_response' => (
128-
isa => 'Bool',
129-
is => 'ro',
130-
required => 0,
131-
default => 0
132-
);
133-
134108
has debug => (
135109
is => 'ro',
136110
isa => 'Bool',

lib/Net/SAML2/IdP.pm

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ Constructor
4545
4646
=item B<entityid>
4747
48-
=item B<sls_force_lcase_url_encoding>
49-
50-
Specifies that the IdP requires the encoding of a URL to be in lowercase.
51-
Necessary for a HTTP-Redirect of a LogoutResponse from Azure in particular.
52-
True (1) or False (0). Some web frameworks and underlying http requests assume
53-
that the encoding should be in the standard uppercase (%2F not %2f)
54-
55-
=item B<sls_double_encoded_response>
56-
57-
Specifies that the IdP response sent to the HTTP-Redirect is double encoded.
58-
The double encoding requires it to be decoded prior to processing.
59-
6048
=back
6149
6250
=cut
@@ -67,8 +55,6 @@ has 'sso_urls' => (isa => 'HashRef[Str]', is => 'ro', required => 1);
6755
has 'slo_urls' => (isa => 'Maybe[HashRef[Str]]', is => 'ro');
6856
has 'art_urls' => (isa => 'Maybe[HashRef[Str]]', is => 'ro');
6957
has 'certs' => (isa => 'HashRef[ArrayRef[Str]]', is => 'ro', required => 1);
70-
has 'sls_force_lcase_url_encoding' => (isa => 'Bool', is => 'ro', required => 0);
71-
has 'sls_double_encoded_response' => (isa => 'Bool', is => 'ro', required => 0);
7258

7359
has 'formats' => (
7460
isa => 'HashRef[Str]',
@@ -114,8 +100,6 @@ sub new_from_url {
114100
return $class->new_from_xml(
115101
xml => $xml,
116102
cacert => $args{cacert},
117-
sls_force_lcase_url_encoding => $args{sls_force_lcase_url_encoding},
118-
sls_double_encoded_response => $args{sls_double_encoded_response},
119103
);
120104
}
121105

@@ -224,8 +208,6 @@ sub new_from_xml {
224208
art_urls => $data->{Art} || {},
225209
certs => \@certs,
226210
cacert => $args{cacert},
227-
sls_force_lcase_url_encoding => $args{sls_force_lcase_url_encoding},
228-
sls_double_encoded_response => $args{sls_double_encoded_response},
229211
$data->{DefaultFormat}
230212
? (
231213
default_format => $data->{DefaultFormat},

lib/Net/SAML2/SP.pm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,6 @@ sub slo_redirect_binding {
399399
cert => $idp->cert('signing'),
400400
key => $self->key,
401401
param => $param,
402-
sls_force_lcase_url_encoding => $idp->{sls_force_lcase_url_encoding},
403-
sls_double_encoded_response => $idp->{sls_double_encoded_response},
404402
);
405403
return $redirect;
406404
}

xt/testapp/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ org_name: "Net::SAML2 Saml2Test"
1616
org_display_name: "Saml2Test app for Net::SAML2"
1717
org_contact: "[email protected]"
1818
error_url: "/error"
19-
sls_force_lcase_url_encoding: "0"
20-
sls_double_encoded_response: "0"

xt/testapp/lib/Saml2Test.pm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ sub _idp {
267267
my $idp = Net::SAML2::IdP->new_from_url(
268268
url => config->{idp},
269269
cacert => config->{cacert},
270-
sls_force_lcase_url_encoding => config->{sls_force_lcase_url_encoding},
271-
sls_double_encoded_response => config->{sls_double_encoded_response}
272270
);
273271
return $idp;
274272
}

0 commit comments

Comments
 (0)