The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::SAML2::Object::Response - A response object

VERSION

version 0.79

SYNOPSIS

    use Net::SAML2::Object::Response;

    my $xml = ...;
    my $response = Net::SAML2::Object::Response->new_from_xml(xml => $xml);

    if (!$response->is_success) {
        warn "Got a response but isn't successful";

        my $status = $response->status;
        my $substatus = $response->substatus;

        warn "We got a $status back with the following sub status $substatus";
    }
    else {
        $response->to_assertion(
            # See Net::SAML2::Protocol::Assertion->new_from_xml for the other
            # construction options
            key_file => ...,
            key_name => ...,
        )
    }

DESCRIPTION

A generic response object to be able to deal with an response from the IdP. If the status is successful you can grab an assertion and continue your flow.

ATTRIBUTES

status

Returns the status of the response

substatus

Returns the sub status of the response

assertions

Returns the nodes of the assertion

METHODS

$self->new_from_xml(xml => $xml)

Creates the response object based on the response XML

$self->to_string

Stringify the object to the full response XML

$self->to_assertion(%args)

Create a Net::SAML2::Protocol::Assertion from the response. See "new_from_xml" in Net::SAML2::Protocol::Assertion for more.

AUTHORS

  • Chris Andrews <chrisa@cpan.org>

  • Timothy Legge <timlegge@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 by Venda Ltd, see the CONTRIBUTORS file for others.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.