VOMS::Lite::SAMLHelper - Perl extension for SAML
use VOMS::Lite::SAMLHelper; %DATA = %{ VOMS::Lite::SAMLHelper::parseSAML($saml) };
VOMS::Lite::SAMLHelper is designed to parse SAML 1 and 2 assertion and protocol statements for SARoNGS. The library exposes two functions which may be of use.
parseSAML
Expects serialised xml (saml) on in $_[0]. Called in scalar context returns 1 if successfully parsed 0 otherwise. Called in array context returns a copy of the parsed object array. If $_[1] is set to an array reference this is used to prime and pass the parsed object array back. Creates new XML::Parser Uses getNode to abstractly parse root node Uses parseElement to parse this abstract root node Parsed object is represented as an array of XPath-like data stings (one array element per data value i.e. may contain \n). e.g. /path/to/node (namespace) /path/to/node{attribute} (attribute.namespace.if.any) = attributevalue ... /path/to/node TextContentIfAny /path/to/node/subnode (namesapce) /path/to/node/subnode{attribute} (attribute.namespace.if.any) = attributevalue ... /path/to/node/subnode TextContentIfAny /path/to/node/subnode/subsubnode... /path/to/node2 (namespace) ... namespaces will be consumed and returned only in parenthase
getSAMLAttributes
Expects serialised xml (saml) on in $_[0]. return { Attributes=>{ (FriendlyName|Name)=Value, ...}, ResponseID=>$ResponseID, Status=>$StatusCodeValue, NotOnOrAfter=>$NotOnOrAfter, NotBefore=>$NotBefore, Subject=>$NameIdentifier, Warnings=> [Anonymous array of warnings] };
None by default;
http://saml.xml.org/saml-specifications
This module was originally designed for the SARoNGS service Hosted by the The University of Manchester on behalf of the UK NGS.
Mailing list, voms-lite@listserv.manchester.ac.uk
Mike Jones <mike.jones@manchester.ac.uk>
Copyright (C) 2012 by Mike Jones
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.
To install VOMS::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VOMS::Lite
CPAN shell
perl -MCPAN -e shell install VOMS::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.