can download plant phenotype data in the same way as plot phenotype data
[sgn.git] / lib / SGN / Authentication / Credentials.pm
blobc1e73600902123e4984affec0eb33dbbc0b282ff
1 package SGN::Authentication::Credentials;
3 use strict;
4 use warnings;
5 use SGN::Authentication::Store;
6 use SGN::Authentication::User;
8 =head1 NAME
10 SGN::Authentication::Credentials - a class providing credentials for the SGN Catalyst system
12 =head1 DESCRIPTION
14 Implemented according to Catalyst::Plugin::Authentication::Internals
16 =head1 AUTHOR
18 Lukas Mueller <lam87@cornell.edu>
20 =cut
22 sub new {
23 my ($class, $config, $app, $realm) = @_;
25 my $self = bless {}, $class;
27 $self->{config} = $config;
28 $self->{app} = $app;
29 $self->{realm} = $realm;
31 return $self;
34 sub authenticate {
35 my $self = shift;
36 my $c = shift;
37 my $realm = shift;
38 my $authinfo = shift;
40 $c->log->debug("authenticate: Authenticating user: $authinfo->{username}") if $c->debug;
41 my $store = SGN::Authentication::Store->new();
42 my $user = $store->find_user($authinfo, $c);
44 return $user;