diff options
author | Michael Kröll <pepl@cpan.org> | 2008-12-01 23:40:08 +0100 |
---|---|---|
committer | Michael Kröll <pepl@cpan.org> | 2008-12-01 23:40:08 +0100 |
commit | e5f4fb7c97dddeee99437e6428e5cb1d87214704 (patch) | |
tree | 9ff93c93b84142b2c23139e513e7425ff061a92d | |
parent | Take baseurl from config (diff) | |
parent | Merge branch 'master' of git@git.useperl.at:PAUSE-OpenID (diff) | |
download | Simple-OpenID-e5f4fb7c97dddeee99437e6428e5cb1d87214704.tar.gz Simple-OpenID-e5f4fb7c97dddeee99437e6428e5cb1d87214704.tar.bz2 Simple-OpenID-e5f4fb7c97dddeee99437e6428e5cb1d87214704.zip |
Merge branch 'master' of git@git.useperl.at:PAUSE-OpenID
-rw-r--r-- | lib/PAUSE/OpenID/Controller/Root.pm | 14 | ||||
-rw-r--r-- | pause_openid.pl | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/PAUSE/OpenID/Controller/Root.pm b/lib/PAUSE/OpenID/Controller/Root.pm index 67d4411..6ffa03b 100644 --- a/lib/PAUSE/OpenID/Controller/Root.pm +++ b/lib/PAUSE/OpenID/Controller/Root.pm @@ -76,22 +76,32 @@ sub login :Local { $c->log->debug('username "'.$username.'" login attempt'); my $ua = LWP::UserAgent->new; + my $req = HTTP::Request->new(GET => 'https://pause.perl.org/pause/authenquery'); + $req->header('If-SSL-Cert-Subject' => '/CN=pause.perl.org'); + local $ENV{HTTPS_CA_DIR} = $c->config->{'ssl'}->{'ca_dir'}; $ua->credentials('pause.perl.org:443', 'PAUSE', $username, $password); - my $res = $ua->get('https://pause.perl.org/pause/authenquery'); + my $res = $ua->request($req); + + die 'pause server certificate validation failed' + if exists $res->headers->{'client-ssl-warning'}; if ($res->code == 200) { $c->log->info('login pass'); + $c->session->{pauseid} = $username; $c->res->redirect($c->uri_for('/login_pass')); } else { $c->log->warn('login failed'); + use Data::Dumper; + die Dumper($res); + $c->res->redirect($c->uri_for('/login_failed')); } } sub login_pass :Local { my ( $self, $c ) = @_; - + $c->res->content_type('text/plain'); $c->res->body('login pass'); } diff --git a/pause_openid.pl b/pause_openid.pl index c89b092..0cf7b2e 100644 --- a/pause_openid.pl +++ b/pause_openid.pl @@ -11,7 +11,7 @@ return { flash_to_stash => 1, expires => 172800, # two days memcached_new_args => { - data => [ "10.10.10.108:11211" ], + data => [ "localhost:11211" ], namespace => "pause_openid_session", }, }, @@ -25,5 +25,9 @@ return { 'PAUSE::OpenID'=>{ baseurl=>'https://id.pause.org/', }, + + 'ssl' => { + 'ca_dir' => '/etc/ssl/certs/', + } }; |