Apache2-AuthTicketLDAP

 view release on metacpan or  search on metacpan

AuthTicketLDAP.pm  view on Meta::CPAN

package Apache2::AuthTicketLDAP;
BEGIN {
  $Apache2::AuthTicketLDAP::VERSION = '0.02';
}

# ABSTRACT: Cookie Based Access with LDAP Authentication

use strict;
use base qw(Apache2::AuthTicket);
use Apache2::Const qw(OK HTTP_FORBIDDEN);
use Apache2::ServerUtil;
use CHI;
use DBI;
use Digest::SHA qw/sha512_hex/;
use Net::LDAP;
use Net::LDAP::Entry; # Necessary to find methods for cached entries

AuthTicketLDAP.pm  view on Meta::CPAN


    return $dbh;
}

1;

=pod

=head1 NAME

Apache2::AuthTicketLDAP - Cookie Ticketing with LDAP Authentication

=head1 VERSION

version 0.02

=head1 SYNOPSIS

 The documentation is largely the same as I<Apache2::AuthTicket>, however, with 
 a few addenda. A typical installation will look like:

 # in httpd.conf
 PerlModule Apache2::AuthTicketLDAP
 PerlSetVar AuthCookieDebug 3 #Useful for debugging
 PerlSetVar AuthTicketLDAPCacheDir "/var/cache/apache"
 PerlSetVar AuthTicketLDAPCacheSize "4m"
 PerlSetVar AuthTicketLDAPCachePageSize "4096"
 PerlSetVar AuthTicketLDAPCacheTTL "10m"
 PerlSetVar AuthTicketLDAPStmtCacheSize "4m"
 PerlSetVar AuthTicketLDAPStmtCachePageSize "4096"
 PerlSetVar AuthTicketLDAPStmtCacheTTL "1m"
 PerlSetVar FooCookieName "MyCookie"
 PerlSetVar FooSatisfy any
 PerlSetVar FooTicketDB dbi:mysql:database=mschout;host=testbed
 PerlSetVar FooTicketDBAutoCommit 0
 PerlSetVar FooTicketDBUser test
 PerlSetVar FooTicketDBPassword secret
 PerlSetVar FooTicketTable tickets:ticket_hash:ts
 PerlSetVar FooTicketSecretTable ticket_secrets:sec_data:sec_version
 PerlSetVar FooTicketExpires 45
 PerlSetVar FooTicketIdleTimeout 30
 PerlSetVar FooTicketThreshold 60

AuthTicketLDAP.pm  view on Meta::CPAN

=head2 Apache Configuration - startup.pl

Any non-global I<Apache2::AuthTicketLDAP> configuration items can be set in
startup.pl. You can configure an AuthName like this:

 Apache2::AuthTicketLDAP->configure(String auth_name, *Hash config)

When configuring this way, you don't prefix the configuration items with the 
AuthName value like you do when using PerlSetVar directives.

You must still include I<Apache2::AuthCookie> configuration directives and
I<Apache2::AuthTicketLDAP> global variables in httpd.conf when configuring the
server this way.  These items include:

  * PerlSetVar FooPath /
  * PerlSetVar FooDomain .foo.com
  * PerlSetVar FooSecure 1
  * PerlSetVar FooLoginScript /foologinform
  * PerlSetVar AuthTicketLDAPCacheDir "/var/cache/apache"
  * PerlSetVar AuthTicketLDAPCacheSize "4m"
  * PerlSetVar AuthTicketLDAPCachePageSize "4096"

AuthTicketLDAP.pm  view on Meta::CPAN

     TicketIdleTimeout   => 5,
     TicketThreshold     => 60,
     LDAPURL             => 'ldap://ldap.foo.com:389',
     LDAPDN              => 'dc=foo,dc=com',
     LDAPScope           => 'one',
     LDAPFilter          => 'uid=MYUSER',
     TicketDBAutoCommit  => 0,
 });

Configuration is the same as with I<Apache2::AuthTicket> and 
I<Apache2::AuthCookie>, though B<TicketUserTable> and B<TicketPasswordStyle>
are ignored.

The following directives are added by this module:

=over 3

=item B<TicketThreshold>

This directive tells the module to only update the database when a ticket 
timestamp is at least X seconds old. Reduces database updates.

AuthTicketLDAP.pm  view on Meta::CPAN

=back

=head1 CREDITS

Many thanks to Michael Schout for writing I<Apache2::AuthTicket>. Additional 
thanks to St. Edward's University for providing the resources to write this 
module.

=head1 SEE ALSO

L<Apache2::AuthTicket>, L<Apache2::AuthCookie>, L<Net::LDAP>, L<CHI>, L<CHI::Driver::FastMmap>

=head1 AUTHOR

Stephen Olander-Waters <stephenw@stedwards.edu>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by St. Edward's University.

This is free software; you can redistribute it and/or modify it under

META.json  view on Meta::CPAN

{
   "abstract" : "Cookie Ticketing with LDAP Authentication",
   "author" : [
      "Stephen Olander-Waters <stephenw@stedwards.edu>"
   ],
   "dynamic_config" : 1,
   "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",

META.yml  view on Meta::CPAN

--- #YAML:1.0
name:               Apache2-AuthTicketLDAP
version:            0.02
abstract:           Cookie Ticketing with LDAP Authentication
author:
    - Stephen Olander-Waters <stephenw@stedwards.edu>
license:            perl
distribution_type:  module
configure_requires:
    ExtUtils::MakeMaker:  0
build_requires:
    ExtUtils::MakeMaker:  0
requires:
    Apache::AuthTicket:  0.93



( run in 0.402 second using v1.01-cache-2.11-cpan-e9199f4ba4c )