Authen-Credential
view release on metacpan or search on metacpan
Authen-Credential
This module offers abstractions of credentials, i.e. something that
can be used to authenticate. It allows the creation and manipulation of
credentials. In particular, it defines a standard string representation
(so that credentials can be given to external programs as command line
options), a standard structured representation (so that credentials can
be stored in structured configuration files or using JSON) and
"preparators" that can transform credentials into ready-to-use data for
well known targets.
Different authentication schemes (aka credential types) are supported.
This package currently supports "none", "plain" and "x509" but others
can be added by providing the supporting code in a separate module.
A Python implementation of the same credential abstractions is available
at https://github.com/cern-mig/python-auth-credential so credentials can
be shared between different programming languages.
INSTALLATION
To install this module, run the following commands:
perl Makefile.PL
make
make test
make install
lib/Authen/Credential.pm view on Meta::CPAN
if ($cred->scheme() eq "plain") {
printf("user name is %s\n", $cred->name());
}
# use the prepare() method to get ready-to-use data
$req = HTTP::Request->new(GET => $url);
$req->header(Authorization => $cred->prepare("HTTP.Basic"));
=head1 DESCRIPTION
This module offers abstractions of credentials, i.e. something that
can be used to authenticate. It allows the creation and manipulation of
credentials. In particular, it defines a standard string representation
(so that credentials can be given to external programs as command line
options), a standard structured representation (so that credentials can
be stored in structured configuration files or using JSON) and
"preparators" that can transform credentials into ready-to-use data for
well known targets.
Different authentication schemes (aka credential types) are supported.
This package currently supports C<none>, C<plain> and C<x509> but others
can be added by providing the supporting code in a separate module.
A Python implementation of the same credential abstractions is available
at L<https://github.com/cern-mig/python-auth-credential> so credentials
can be shared between different programming languages.
For a given scheme, a credential is represented by an object with a
fixed set of string attributes. For instance, the C<plain> scheme has
two attributes: C<name> and C<pass>. More information is provided by
the scheme specific module, for instance L<Authen::Credential::plain>.
=head1 STRING REPRESENTATION
The string representation of a credential is made of its scheme
( run in 0.239 second using v1.01-cache-2.11-cpan-4d50c553e7e )