Apache2-AuthCASSimple

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl module Apache2::AuthCASSimple

0.10  Thu, 10 May 2009 11:53:07 +0200
    - add dep on Crypt::SSLeay
    - swap clean login_url (0.07 was a bad idea) with uri_escape
    - fix _post_to_get with $r->read closes  https://rt.cpan.org/Ticket/Display.html?id=45923
    - add test cases in examples

0.09 Wed, 22 Apr 2009 12:33:26 +0200
    - revert use of CGI, better fix up for REMOTE_USER bug

0.08 Wed, 22 Apr 2009 08:28:46 +0200
    - fix REMOTE_USER not set bug 
    closes cpan http://rt.cpan.org/Ticket/Display.html?id=45202
    closes debian bug #525097

lib/Apache2/AuthCASSimple.pm  view on Meta::CPAN

  $options{casUrl} = ($cas_ssl ? 'https://' : 'http://').$cas_name.$cas_port.$cas_path;
 # $log->info('==casUrl==='.$options{casUrl}.'____');
 # $options{CAFile} = $cfg->{_ca_file} if ($cfg->{_cas_ssl});

  unless($cas = Authen::CAS::Client->new($options{casUrl}, fatal => 1)) {
    $log->error(__PACKAGE__.": Unable to create CAS instance.");
    return SERVER_ERROR;
  }

  my $requested_url = _get_requested_url($r,$mod_proxy);
  my $login_url = uri_escape $requested_url;
  $login_url = $cas->login_url().$login_url;
  #$log->info( '==login_url==='.$login_url.'____');

  my %args = map { split '=', $_ }  split '&', $r->args();
  my $ticket = $args{'ticket'};
  # redirect to CAS server unless ticket parameter
  unless ($ticket) {
    $log->info(__PACKAGE__.": No ticket, client redirected to CAS server. ".$login_url);
    $r->headers_out->add("Location" => $login_url);
    return REDIRECT;



( run in 0.411 second using v1.01-cache-2.11-cpan-c21f80fb71c )