Lemonldap::NG::Portal::Auth::Base - Base module for LemonLDAP::NG authentication modules.
package Lemonldap::NG::Portal::Auth::My; use strict; use Mouse; # Add constants used by this module use Lemonldap::NG::Portal::Main::Constants qw(PE_OK); our $VERSION = '0.1'; extends 'Lemonldap::NG::Portal::Auth::Base'; sub init { ... } sub extractFormInfo { my ( $self, $req ) = @_; ... } sub authenticate { my ( $self, $req ) = @_; ... } sub authLogout { my ( $self, $req ) = @_; ... } sub getDisplayType { return ...; } 1;
This base library must be used to build Lemonldap::NG authentication modules. Authentication modules are independent objects that are instantiated by Lemonldap::NG portal. They must provides methods described below.
Like any module that inherits from Lemonldap::NG::Portal::Plugin, Lemonldap::NG::Portal::Auth::Base provides URI path functions:
Exemple:
sub init { ... $self->addAuthRoute( saml => { proxy => "proxySub" }, [ 'GET', 'POST' ] ); ... } sub proxySub { my ( $self, $req ) = @_; ... # This sub must return a PSGI response. Example return [ 302, [ Location => 'http://x.y/' ], [] ]; }
This means that requests http://auth.../saml/proxy will be given to proxySub() method.
Method launched after object creation (after each configuration reload). It must return a true value if authentication module is ready, false else.
All these methods must return a Lemonldap::NG::Portal::Main::Constants value. They are called with one argument: a Lemonldap::NG::Portal::Main::Request object.
Note: if you want to change process() next steps, you just have to change $req->steps array.
First authentication method called during authentication process. It must set $req->user that will be used by the userDB object to get user information.
Last method called during authentication process.
Logging is provided by $self->logger and $self->userLogger. The following rules must be applied:
Use OW2 system to report bug or ask for features: http://jira.ow2.org
Lemonldap::NG is available at http://forge.objectweb.org/project/showfiles.php?group_id=274
See COPYING file for details.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
To install Lemonldap::NG::Portal, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lemonldap::NG::Portal
CPAN shell
perl -MCPAN -e shell install Lemonldap::NG::Portal
For more information on module installation, please visit the detailed CPAN module installation guide.