Compte de connexion LDAP : optionnel, à renseigner si les attributs LDAP
utilisés ne sont pas accessibles par une session anonyme. Ce compte est
utilisé avant l'authentification pour trouver le dn de l'utilisateur ;
@@ -404,6 +433,21 @@ users member of 'group1'. You can also use 'accept' and 'deny' keywords.
If URL doesn't match any regular expression, 'default' rule is called to
grant or not.
+ Logout
+
+You can also write Logout rules to intercept application logout url using the
+reserved words :
+
+ - logout_sso URL : the request generates a redirection to the portal to call
+ logout mechanism. The request is not given to the application so its logout
+ function is not called. After logout, the user is redirected to the URL,
+ - logout_app URL : the request is transmitted to the application, but the
+ result is not displayed : the user is redirected to the URL,
+ - logout_app_sso URL : the request is transmitted to the application and
+ then, the user is redirected to the portal with the logout call and then,
+ he is redirected to the given URL.
+
+
Headers
Headers are used to inform the remote application on the connected user.
@@ -452,6 +496,24 @@ tous les utilisateurs authentifiés peuvent accéder.
droit d'accès est calculé à partir de l'expression booléenne définie dans
la règle par défaut (default).
+ Logout
+
+Vous pouvez également écrire des règles pour intercepter
+les URL de déconnexions des applications en utilisant les mots-clefs :
+
+ - logout_sso URL : la requête entraine une redirection vers le portail
+ avec l'appel au système de déloguage. La requête n'est
+ pas transmise à l'applicationthe. Après déloguage,
+ l'utilisateur est renvoyé vers l'URL,
+ - logout_app URL : la requête est transmise à l'applications
+ mais le résultat n'est pas affiché : l'utilisateur est
+ redirigé vers l'URL,
+ - logout_app_sso URL : la requête est transmise à l'application
+ et ensuite, l'utilisateur est redirigé vers le portail avec appel au
+ système de déloguage. Il est ensuite redirigé vers
+ l'URL.
+
+
En-têtes
Les en-têtes servant à l'application à savoir qui est connecté se déclarent
@@ -478,9 +540,9 @@ EOT
sub help_whatToTrace_fr {
print <Donnée à journaliser dans Apache
- Indiquez ici le nom de la variable (attribut) ou de la macro qui doit être
-utilisée pour alimenter les journaux Apache des applications protégées
-(n'oubliez pas le "\$"). Par défaut : \$uid
+Donnée à journaliser dans Apache
+ Indiquez ici le nom de la variable (attribut) ou de la macro qui doit être
+utilisée pour alimenter les journaux Apache des applications protégées
+(n'oubliez pas le "\$"). Par défaut : \$uid
EOT
}
diff --git a/modules/lemonldap-ng-portal/Changes b/modules/lemonldap-ng-portal/Changes
index 7438d0309..e0df387a6 100644
--- a/modules/lemonldap-ng-portal/Changes
+++ b/modules/lemonldap-ng-portal/Changes
@@ -1,5 +1,9 @@
Revision history for Perl extension Lemonldap::NG::Portal.
+0.76 Sat Jul 21 15:21:57 2007
+ - LDAP+TLS support (thanks to Baptiste Grenier)
+ - New logout system: URL can now be declared in Manager interface
+
0.75 Tue Jul 3 20:42:09 2007
- Security fix: authentication could be replayed with another uid
diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
index 953474c18..4b84048ff 100644
--- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
+++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
@@ -2,7 +2,7 @@ package Lemonldap::NG::Portal;
print STDERR
"See Lemonldap::NG::Portal(3) to know which Lemonldap::NG::Portal::* module to use.";
-our $VERSION = "0.75";
+our $VERSION = "0.76";
1;
@@ -259,8 +259,8 @@ L module that does not use disk access.
Lemonldap::NG provides a single logout system: you can use it by adding a link
to the portal with "logout=1" parameter (See Synopsis) and/or by configuring
-Handler to intercept some URL (See L). The logout
-system:
+Handler to intercept some URL directly in the manager interface and/or in
+Apache configuration file (See L). The logout system:
=over
diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
index 126fdf70c..f1b108c98 100644
--- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
+++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
@@ -13,7 +13,7 @@ use CGI::Cookie;
require POSIX;
use Lemonldap::NG::Portal::_i18n;
-our $VERSION = '0.75';
+our $VERSION = '0.76';
our @ISA = qw(CGI Exporter);
@@ -199,6 +199,14 @@ sub controlExistingSession {
# Delete cookie
$self->{id} = "";
$self->buildCookie();
+ if( $self->{urldc} ) {
+ if( $self->{autoRedirect} ) {
+ &{ $self->{autoRedirect} }($self);
+ }
+ else {
+ $self->autoRedirect();
+ }
+ }
return PE_FIRSTACCESS;
}
$self->{id} = $id;
@@ -265,7 +273,17 @@ sub formateFilter {
sub connectLDAP {
my $self = shift;
return PE_OK if ( $self->{ldap} );
+ my $useTls = 0;
+ my $tlsParam;
foreach my $server ( split /[\s,]+/, $self->{ldapServer} ) {
+ if ( $server =~ m{^ldap\+tls://([^/]+)/?\??(.*)$} ) {
+ $useTls = 1;
+ $server = $1;
+ $tlsParam = $2 || "";
+ }
+ else {
+ $useTls = 0;
+ }
last if $self->{ldap} = Net::LDAP->new(
$server,
port => $self->{ldapPort},
@@ -273,6 +291,13 @@ sub connectLDAP {
);
}
return PE_LDAPCONNECTFAILED unless ( $self->{ldap} );
+ if ($useTls) {
+ my %h = split( /[&=]/, $tlsParam );
+ $h{cafile} = $self->{caFile} if( $self->{caFile} );
+ $h{capath} = $self->{caPath} if( $self->{caPath} );
+ my $mesg = $self->{ldap}->start_tls(%h);
+ $mesg->code && return PE_LDAPCONNECTFAILED;
+ }
PE_OK;
}
@@ -510,6 +535,11 @@ Lemonldap::Portal::* libraries.
=item * ldapServer: server(s) used to retrive session informations and to valid
credentials (localhost by default). More than one server can be set here
separated by commas. The servers will be tested in the specifies order.
+To use TLS, set "ldap+tls://server" and to use LDAPS, set "ldaps://server"
+instead of server name. If you use TLS, you can set any of the
+Net::LDAP->start_tls() sub like this:
+ "ldap/tls://server/verify=none&capath=/etc/ssl"
+You can also use caFile and caPath parameters.
=item * ldapPort: tcp port used by ldap server.
@@ -521,15 +551,15 @@ bind is used.
=item * managerPassword: password to used to connect to ldap server. By
default, anonymous bind is used.
-=item * securedCookie: set it to 1 if you want to protect user cookies
+=item * securedCookie: set it to 1 if you want to protect user cookies.
-=item * cookieName: name of the cookie used by Lemonldap::NG (lemon by default)
+=item * cookieName: name of the cookie used by Lemonldap::NG (lemon by default).
=item * domain: cookie domain. You may have to give it else the SSO will work
only on your server.
=item * globalStorage: required: L library to used to store
-session informations
+session informations.
=item * globalStorageOptions: parameters to bind to L module
@@ -542,6 +572,10 @@ be set to:
=back
+=item * caPath, caFile: if you use ldap+tls you can overwrite cafile or capath
+options with those parameters. This is usefull if you use a shared
+configuration.
+
=back
=head2 Methods that can be overloaded