Net::SA...Request(3)

πŸ“¦ version 0.85, in alpine 3.24

okay so this is the Net::SA...Request(3) page from the User Contributed Perl Documentation, aka the Net::SAML2::Protocol::AuthnRequest page β€” it's giving major main character energy and it's literally all about the SAML2 AuthnRequest object πŸ’….

πŸ’– NAME πŸ’–

Net::SAML2::Protocol::AuthnRequest β€” SAML2 AuthnRequest object. That's the whole vibe, bestie πŸ¦‹.

✨ VERSION ✨

version 0.85 β€” yes ma'am, that's the version 🌸.

🌈 SYNOPSIS 🌈

okay so here's the group-chat recap of how you use it. First flavor:

  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)
  );

πŸ’… METHODS πŸ’…

πŸŽ€ new( ... ) πŸŽ€

Constructor. Creates an instance of the AuthnRequest object. It's giving main character energy ✨.

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. no cap, that's the security vibe check πŸ”₯.

Arguments:

  • nameidpolicy_format β€” the Format attribute for NameIDPolicy πŸŽ€.
  • AuthnContextClassRef, <AuthnContextDeclRef β€” each one is an arrayref containing values for AuthnContextClassRef and AuthnContextDeclRef. If any is populated, the RequestedAuthnContext will be included in the request πŸ’œ.
  • RequestedAuthnContext_Comparison β€” the value for the Comparison attribute in case RequestedAuthnContext is included (see above). Default value is exact ⭐.
  • identity_providers β€” an arrayref of Identity providers; if used, the Scoping element is added to the XML 🌸.

πŸ¦‹ as_xml( ) πŸ¦‹

Returns the AuthnRequest as XML. That's it, that's the whole method, and it ate πŸ’….

πŸ‘‘ AUTHOR πŸ‘‘

Timothy Legge <timlegge@gmail.com> β€” iconic, periodt πŸ’–.

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


okay bye bestie, this page was rendered with perl v5.42.2 on 2026-02-11, and it's the Net::SA...Request(3) page πŸ’–βœ¨πŸŽ€.

πŸ“¦ where this page comes from