Net::SA...Redirect(3)
β¨ NAME β¨
Okay bestie, welcome to Net::SAML2::Binding::Redirect(3) β the manual name situation is User Contributed Perl Documentation, and this page is literally the HTTP Redirect binding for SAML. It's giving auth-flow main character energy, no cap.
Net::SAML2::Binding::Redirect β HTTP Redirect binding for SAML.
πΈ VERSION πΈ
version 0.85 β small number, iconic behavior.
π¦ SYNOPSIS π¦
my $redirect = Net::SAML2::Binding::Redirect->new(
key => '/path/to/SPsign-nopw-key.pem', # Service Provider (SP) private key
url => $sso_url, # Service Provider Single Sign Out URL
param => 'SAMLRequest' OR 'SAMLResponse', # Type of request
cert => $idp->cert('signing') # Identity Provider (IdP) certificate
sig_hash => 'sha256', 'sha224', 'sha384', 'sha512' or 'sha1' # Signature to sign request
);
my $url = $redirect->sign($authnreq);
my $ret = $redirect->verify($url);
π METHODS π
π± new( ... )
Constructor, bestie. Creates an instance of the Redirect binding.
Arguments:
keyβ The SP's (Service Provider) β also known as your application's β signing key that your application uses to sign theAuthnRequest. Some IdPs may not verify the signature.
Usually required when param is "SAMLRequest".
If you don't want to sign the request, you can pass insecure => 1 and not provide a key; in this case, sign will return a non-signed URL.
certβ The IdP's (Identity Provider's) certificate that is used to verify a signed Redirect from the IdP. It is used to verify the signature of the Redirect response. Required withparambeing"SAMLResponse".urlβ The IdP's SSO (Single Sign Out) service url for the Redirect binding. Required withparambeing"SAMLRequest".paramβ query param name to use (SAMLRequest,SAMLResponse). Defaults to"SAMLRequest".sig_hashβ RSA signature hash used to sign request. Supported:sha256,sha224,sha384,sha512andsha1. Defaults to"sha256".debugβ Output extra debugging information.
π get_redirect_uri($authn_request, $relaystate)
Get the redirect URI for a given request, and returns the URL to which the user's browser should be redirected.
Accepts an optional RelayState parameter, a string which will be returned to the requestor when the user returns from the authentication process with the IdP.
The request is signed unless the the object has been instantiated with "<insecure =" 1>> β yes, the double βtheβ is in the source, leave it alone π
.
βοΈ sign( $request, $relaystate )
Signs the given request, and returns the URL to which the user's browser should be redirected.
Accepts an optional RelayState parameter, a string which will be returned to the requestor when the user returns from the authentication process with the IdP.
Returns the signed (or unsigned) URL for the SAML2 redirect.
π verify( $query_string )
my ($request, $relaystate) = $self->verify($query_string)
Decode a Redirect binding URL.
Verifies the signature on the response.
β οΈ Bestie, this one requires the raw query string to be passed, because URI parses and re-encodes URI-escapes in uppercase (%3fbecomes%3F, for instance), which leads to signature verification failures if the other party uses lower case (or mixed case). Do not pass the processed vibe; pass the raw one.
Returns an ARRAY of containing the verified request and relaystate (if it exists) β yes, the docs really say it like that π. Croaks on errors.
π«Ά AUTHOR π«Ά
Timothy Legge <timlegge@gmail.com> β author, icon, legend.
π COPYRIGHT AND LICENSE π
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.
Cute sign-off: this page is from perl v5.42.2, dated 2026-02-11, and its footer calls it Net::SA...Redirect(3). Mwah π
π¦ where this page comes from
- alpine 3.24: perl-net-saml2-doc 0.85-r0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms