Skip to content

Commit

Permalink
Fixes #29 which also supports Auth0 SAML
Browse files Browse the repository at this point in the history
  • Loading branch information
timlegge committed Jul 23, 2021
1 parent 09591b6 commit 95a2311
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ my %WriteMakefileArgs = (
"Crypt::PK::ECC" => 0,
"DateTime" => 0,
"DateTime::Format::XSD" => 0,
"DateTime::HiRes" => 0,
"Digest::SHA" => 0,
"Exporter" => 0,
"File::Slurp" => 0,
Expand Down Expand Up @@ -87,6 +88,7 @@ my %FallbackPrereqs = (
"Crypt::PK::ECC" => 0,
"DateTime" => 0,
"DateTime::Format::XSD" => 0,
"DateTime::HiRes" => 0,
"Digest::SHA" => 0,
"Exporter" => 0,
"File::Slurp" => 0,
Expand Down
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ DESCRIPTION
Jump
Mircosoft ADFS
Keycloak
Auth0 (requires Net::SAML2 >=0.38)

NAME
Net::SAML2 - SAML bindings and protocol implementation
Expand Down
1 change: 1 addition & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ requires "Crypt::OpenSSL::X509" => "0";
requires "Crypt::PK::ECC" => "0";
requires "DateTime" => "0";
requires "DateTime::Format::XSD" => "0";
requires "DateTime::HiRes" => "0";
requires "Digest::SHA" => "0";
requires "Exporter" => "0";
requires "File::Slurp" => "0";
Expand Down
2 changes: 2 additions & 0 deletions lib/Net/SAML2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ Identity Providers (IdPs). It has been tested against:
=item Keycloak
=item Auth0 (requires Net::SAML2 >=0.38)
=back
=head1 MAJOR CAVEATS
Expand Down
5 changes: 3 additions & 2 deletions lib/Net/SAML2/Protocol/Assertion.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use Moose;
use MooseX::Types::DateTime qw/ DateTime /;
use MooseX::Types::Common::String qw/ NonEmptySimpleStr /;
use DateTime;
use DateTime::HiRes;
use DateTime::Format::XSD;
use Net::SAML2::XML::Util qw/ no_comments /;
use XML::LibXML;
Expand Down Expand Up @@ -77,7 +78,7 @@ sub new_from_xml {
$xpath->findvalue('//saml:Conditions/@NotBefore'));
}
else {
$not_before = DateTime->now();
$not_before = DateTime::HiRes->now();
}

my $not_after;
Expand Down Expand Up @@ -139,7 +140,7 @@ sub valid {
return 0 unless !defined $in_response_to
or $in_response_to eq $self->in_response_to;

my $now = DateTime::->now;
my $now = DateTime::HiRes->now;

# not_before is "NotBefore" element - exact match is ok
# not_after is "NotOnOrAfter" element - exact match is *not* ok
Expand Down

0 comments on commit 95a2311

Please sign in to comment.