Authen::NZRealMe::TokenGenerator - generate SAML ID strings
This class is responsible for generating random ID tokens such as:
Although the methods are described below, the preferred way to use this class is via the ServiceProvider:
$sp->generate_saml_id( args );
Any arguments provided will be ignored if
strong_token is used (see below) or will be passed to
weak_token for the fallback implementation.
Constructor. Should not be called directly. Instead, call:
Generates and returns a hex-encoded random token (guaranteed to start with a letter) using
strong_token if possible and
On systems where the device /dev/urandom is available, it will be used. This method will read 20 bytes from the random device and return a hex-encoded representation of those bytes.
Otherwise, returns undef.
Will be called if
strong_token is not able to find a strong source of random data. As this method uses Perl's built-in
rand function, which is not a cryptographically strong source of randomness, its use should be avoided.
If your platform does not provide /dev/urandom, you are advised to use the
Authen::NZRealMe->register_class method to provide an alternative implementation for
See Authen::NZRealMe for documentation index.
Copyright (c) 2014-2019 Enrolment Services, New Zealand Electoral Commission
Written by Grant McLean <firstname.lastname@example.org>
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.