Mojo::SAML::IdP - A convenience module to extract information from an IdP entity descriptor document
Mojo::SAML::IdP is a convenience class for extracting information from IdP entity descriptor metadata. This module is especially fragile and will change as its usefulness is assessed and improved.
Mojo::SAML::IdP inherits all of the attributes from Mojo::Base and implements the following new ones.
The entity id (entityID) of the entity to be inspected. If the "metadata" contains only one entity descriptor, it will default to that id. Otherwise, it must be specified manually otherwise it will throw an exception.
entityID
The metadata of the entity, as a Mojo::DOM object. Note that there are several methods which can be used to populate this values. Otherwise accessing it without it being set will throw an exception.
An instance of Mojo::UserAgent used to fetch remote metadata.
Mojo::SAML::IdP inherits all of the methods from Mojo::Base and implements the following new ones.
my $cert = $idp->certificate_for($use);
Returns a Crypt::OpenSSL::X509 instance for the "entity" and a given use.
Crypt::OpenSSL::X509
my $format = $idp->default_id_format;
Returns the first nameid format.
my $entity = $idp->entity;
Get the Mojo::DOM instance for the entity identified by the "entity_id". This is used by many other methods for picking the entity information.
my $idp = Mojo::SAML::IdP->new->from_file($path);
Load "metadata" from a given file. Return the instance, designed to chain with new.
new
my $idp = Mojo::SAML::IdP->new->from_url($url);
Load "metadata" from a given url using the "ua". Return the instance, designed to chain with new.
my $idp = Mojo::SAML::IdP->new->from_xml($url);
Load "metadata" from a given string. Return the instance, designed to chain with new.
my $url = $idp->location_for($service, $binding);
Extract a Mojo::URL for the "entity"'s given service and binding. The binding may be shortend in a manner that can be fully qualified via "binding" in Mojo::SAML::Names.
$format = $idp->name_id_format($format);
Return the nameid format for the "entity" if the nameid format given is accepted. The format may be shortend in a manner that can be fully qualified via "nameid_format" in Mojo::SAML::Names.
my $pub = $idp->public_key_for($use);
A wrapper for "certificate_for" which returns a Crypt::OpenSSL::RSA public key instance for the certificate.
my $verified = $idp->verify_signature; my $verified = $idp->verify_signature($pub);
Verify the metadata file's signature, either against itself or against a passed in public key. Returns undef if no signature is found or a boolean signifying verification.
To install Mojo::SAML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::SAML
CPAN shell
perl -MCPAN -e shell install Mojo::SAML
For more information on module installation, please visit the detailed CPAN module installation guide.