Apache-AuthCookieLDAP
view release on metacpan or search on metacpan
AuthCookieLDAP.pm view on Meta::CPAN
use Apache::File;
use Digest::MD5 qw( md5_hex );
use Date::Calc qw( Today_and_Now Add_Delta_DHMS );
# Also uses Crypt::CBC if you're using encrypted cookies.
use Net::LDAP qw(LDAP_SUCCESS);
#===============================================================================
# F U N C T I O N D E C L A R A T I O N S
#===============================================================================
sub _log_not_set($$);
sub _dir_config_var($$);
sub _dbi_config_vars($);
sub _now_year_month_day_hour_minute_second();
sub _percent_encode($);
sub _percent_decode($);
sub authen_cred($$\@);
sub authen_ses_key($$$);
sub group($$$);
AuthCookieLDAP.pm view on Meta::CPAN
If a ticket has expired or is otherwise invalid it is cleared in the browser
and the login form is shown again.
=cut
#===============================================================================
# P R I V A T E F U N C T I O N S
#===============================================================================
#-------------------------------------------------------------------------------
# _log_not_set -- Log that a particular authentication variable was not set.
sub _log_not_set($$)
{
my( $r, $variable ) = @_;
my $auth_name = $r->auth_name;
$r->log_error( "Apache::AuthCookieLDAP: $variable not set for auth realm
$auth_name", $r->uri );
}
#-------------------------------------------------------------------------------
# _dir_config_var -- Get a particular authentication variable.
AuthCookieLDAP.pm view on Meta::CPAN
=over 4
=item C<WhatEverLDAP_DN>
Specifies the BaseDN for LDAP for the database you wish to connect to retrieve
user information. This is required and has no default value.
=cut
unless ( $c{ LDAP_DN } = _dir_config_var $r, 'LDAP_DN' ) {
_log_not_set $r, 'LDAP_DN';
return undef;
}
=item C<WhatEverLDAP_user>
Specifies the user id in the database you wish to connect to retrieve
user information. This is required and has no default value.
=cut
unless ( $c{ LDAP_user } = _dir_config_var $r, 'LDAP_user' ) {
_log_not_set $r, 'LDAP_user';
return undef;
}
=item C<WhatEverLDAP_host>
The host to connect to. This is not required and defaults to localhost.
=cut
$c{ LDAP_host } = _dir_config_var( $r, 'LDAP_host' )
AuthCookieLDAP.pm view on Meta::CPAN
readable by root. It is read at server startup time.
The key should be long and fairly random. If you want, you
can change it and restart the server, (maybe daily), which will invalidate
all prior-issued tickets.
=cut
unless (
$c{ LDAP_secretkeyfile } = _dir_config_var $r, 'LDAP_SecretKeyFile'
) {
_log_not_set $r, 'LDAP_SecretKeyFile';
return undef;
}
=item C<WhatEverLDAP_EncryptionType>
What kind of encryption to use to prevent the user from looking at the fields
in the ticket we give them. This is almost completely useless, so don't
switch it on unless you really know you need it. It does not provide any
protection of the password in transport; use SSL for that. It can be 'none',
'des', 'idea', 'blowfish', or 'blowfish_pp'.
AuthCookieLDAP.pm view on Meta::CPAN
## This is for some leftover DBI code:
=item C<WhatEverDBI_DSN>
Specifies the DSN for DBI for the database you wish to connect to retrieve
user information. This is required and has no default value.
=cut
unless ( $c{ DBI_DSN } = _dir_config_var $r, 'DBI_DSN' ) {
_log_not_set $r, 'DBI_DSN';
return undef;
}
=item C<WhatEverDBI_User>
The user to log into the database as. This is not required and
defaults to undef.
=cut
( run in 0.243 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )