Net::SPID::SAML::AuthnRequest
version 0.12
use Net::SPID; # initialize our SPID object my $spid = Net::SPID->new(...); # get an IdP my $idp = $spid->get_idp('https://www.prova.it/'); # generate an AuthnRequest my $authnreq = $idp->authnrequest( acs_index => 0, # index of AssertionConsumerService as per our SP metadata attr_index => 1, # index of AttributeConsumingService as per our SP metadata level => 1, # SPID level ); my $url = $authnreq->redirect_url;
This class represents an AuthnRequest.
This class is not supposed to be instantiated directly. You can craft an AuthnRequest by calling the "authnrequest" in Net::SPID::SAML::IdP method on a Net::SPID::SAML::IdP object.
This method returns the raw message in XML format (signed).
my $xml = $authnreq->xml;
This method returns the full URL of the Identity Provider where user should be redirected in order to initiate their Single Sign-On. In SAML words, this implements the HTTP-Redirect binding.
my $url = $authnreq->redirect_url(relaystate => 'foobar');
The following arguments can be supplied:
(Optional.) An arbitrary payload can be written in this argument, and it will be returned to us along with the Response/Assertion. Please note that since we're passing this in the query string it can't be too long otherwise the URL will be truncated and the request will fail. Also note that this is transmitted in clear-text.
Alessandro Ranellucci <aar@cpan.org>
This software is Copyright (c) 2018 by Alessandro Ranellucci.
This is free software, licensed under:
The (three-clause) BSD License
To install Net::SPID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SPID
CPAN shell
perl -MCPAN -e shell install Net::SPID
For more information on module installation, please visit the detailed CPAN module installation guide.