Lemonldap::NG::Portal 0.02 review
DownloadLemonldap::NG::Portal is a Perl extension for building Lemonldap compatible portals. SYNOPSIS use Lemonldap::NG::Portal; m
|
|
Lemonldap::NG::Portal is a Perl extension for building Lemonldap compatible portals.
SYNOPSIS
use Lemonldap::NG::Portal;
my $portal = new Lemonldap::NG::Portal(
domain => 'gendarmerie.defense.gouv.fr',
storageModule => 'Apache::Session::MySQL',
storageOptions => {
DataSource => 'dbi:mysql:database=dbname;host=127.0.0.1',
UserName => 'db_user',
Password => 'db_password',
TableName => 'sessions',
LockDataSource => 'dbi:mysql:database=dbname;host=127.0.0.1',
LockUserName => 'db_user',
LockPassword => 'db_password',
},
ldapServer => 'ldap.domaine.com',
cookie_secure => 1,
);
# Example of overloading: choose the LDAP variables to store
$portal->{setSessionInfo} = sub {
my ($self) = @_;
foreach $_ qw(uid cn mail appli) {
$self->{sessionInfo}->{$_} = $entry->get_value($_);
}
PE_OK;
};
if($portal->process()) {
# Write here the menu with CGI methods. This page is displayed ONLY IF
# the user was not redirected here.
print $portal->header; # DON'T FORGET THIS (see L)
print "...";
# or redirect the user to the menu
print $portal->redirect( -uri => 'https://portal/menu');
}
else {
# Write here the html form used to authenticate with CGI methods.
# $portal->error returns the error message if athentification failed
# Warning: by defaut, input names are "user" and "password"
print $portal->header; # DON'T FORGET THIS (see L)
print "...";
print '';
# In your form, the following value is required for redirection
print 'param('url').'">';
# Next, login and password
print 'Login : ';
print 'Password : ';
print '';
}
Lemonldap is a simple Web-SSO based on Apache::Session modules. It simplifies the build of a protected area with a few changes in the application (they just have to read some headers for accounting).
It manages both authentication and authorization and provides headers for accounting. So you can have a full AAA protection for your web space. There are two ways to build a cross domain authentication:
Cross domain authentication itself (Lemonldap::Portal::Cda (not yet implemented in Lemonldap::NG))
Liberty Alliance (See Lemonldap::ServiceProvider and Lemonldap::IdentityProvider)
This library is a way to build Lemonldap compatible portals. You can use it either by inheritance or by writing anonymous methods like in the example above.
Requirements:
Perl
Lemonldap::NG::Portal 0.02 search tags