Catalyst::Plugin::Authentication::Credential::TypeKey - TypeKey Authentication for Catalyst.
use Catalyst qw/Authentication::Credential::TypeKey/; MyApp->config->{authentication}{typekey} = { token => 'xxxxxxxxxxxxxxxxxxxx', }; sub foo : Local { my ( $self, $c ) = @_; if ( $c->authenticate_typekey ) { # you can also specify the params manually: $c->authenticate_typekey( # name => $name, # email => $email, # ... #) # successful autentication $c->user; # this is set } } sub auto : Private { my ( $self, $c ) = @_; $c->authenticate_typekey; # uses $c->req return 1; }
This module integrates Authen::TypeKey with Catalyst::Plugin::Authentication.
Fills the config with defaults.
<$c-config->{autentication}{typekey}>> is a hash with these fields (all can be left out):
<$c-
If this field does not exist an Authen::TypeKey object will be created based on the other param and put here.
See Authen::TypeKey for all of these. If they aren't specified Authen::TypeKey's defaults will be used.
Also see Authen::TypeKey.
Defaults to regkeys.txt under "class2tempdir" in Catalyst::Utils.
regkeys.txt
A store (or store name) to retrieve the user from.
When a user is successfully authenticated it will call this:
$store->get_user( $name, $parameters, $result_of_verify );
Where $parameters is a the hash reference passed to "verify" in Authen::TypeKey, and $result_of_verify is the value returned by "verify" in Authen::TypeKey.
$parameters
$result_of_verify
If this is unset, "default_auth_store" in Catalyst::Plugin::Authentication will be used instead.
If auth_store or the default store returns nothing from get_user, this class will be used to instantiate an object by calling new on the class with the return value from "verify" in Authen::TypeKey.
auth_store
new
Authen::TypeKey, Catalyst, Catalyst::Plugin::Authentication.
Christian Hansen
Yuval Kogman, nothingmuch@woobling.org
nothingmuch@woobling.org
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
To install Catalyst::Plugin::Authentication::Credential::TypeKey, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::Authentication::Credential::TypeKey
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::Authentication::Credential::TypeKey
For more information on module installation, please visit the detailed CPAN module installation guide.