GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::SAML2::Protocol::AuthnRequest(3) User Contributed Perl Documentation Net::SAML2::Protocol::AuthnRequest(3)

Net::SAML2::Protocol::AuthnRequest - SAML2 AuthnRequest object

version 0.82

  my $authnreq = Net::SAML2::Protocol::AuthnRequest->new(
    id            => 'NETSAML2_Crypt::OpenSSL::Random::random_pseudo_bytes(16),
    issuer        => $self->{id},       # Service Provider (SP) Entity ID
    destination   => $destination,      # Identity Provider (IdP) SSO URL
    provider_name => $provider_name,    # Service Provider (SP) Human Readable Name
    issue_instant => DateTime->now,     # Defaults to Current Time
    force_authn   => $force_authn,      # Force new authentication (Default: false)
    is_passive    => $is_passive,       # IdP should not take control of UI (Default: false)
  );
  my $request_id = $authnreq->id;       # Store and Compare to InResponseTo
  or
  my $request_id = 'NETSAML2_' . unpack 'H*', Crypt::OpenSSL::Random::random_pseudo_bytes(16);
  my $authnreq = Net::SAML2::Protocol::AuthnRequest->as_xml(
    id            => $request_id,       # Unique Request ID will be returned in response
    issuer        => $self->{id},       # Service Provider (SP) Entity ID
    destination   => $destination,      # Identity Provider (IdP) SSO URL
    provider_name => $provider_name,    # Service Provider (SP) Human Readable Name
    issue_instant => DateTime->now,     # Defaults to Current Time
    force_authn   => $force_authn,      # Force new authentication (Default: false)
    is_passive    => $is_passive,       # IdP should not take control of UI (Default: false)
  );

Constructor. Creates an instance of the AuthnRequest object.

Important Note: Best practice is to always do this first. While it is possible to call as_xml() first you do not have to set the id as it will be set for you automatically.

However tracking the id is important for security to ensure that the response has the same id in the InResponseTo attribute.

Arguments:

Format attribute for NameIDPolicy
Each one is an arrayref containing values for AuthnContextClassRef and AuthnContextDeclRef. If any is populated, the RequestedAuthnContext will be included in the request.
Value for the Comparison attribute in case RequestedAuthnContext is included (see above). Default value is exact.
An arrayref of Identity providers, if used the Scoping element is added to the XML

Returns the AuthnRequest as XML.

  • Chris Andrews <chrisa@cpan.org>
  • Timothy Legge <timlegge@gmail.com>

This software is copyright (c) 2025 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.

2025-05-27 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.