1Lemonldap::NG::Portal::UUsseerrDCBo(n3t)ributed Perl DocLuemmeonntladtaipo:n:NG::Portal::UserDB(3)
2
3
4

NAME

6       Lemonldap:NG::Portal::UserDB - Writing authentication modules for
7       LemonLDAP::NG.
8

SYNOPSIS

10         package Lemonldap::NG::Portal::UserDB::My;
11
12         use strict;
13         use Mouse;
14         # Add constants used by this module
15         use Lemonldap::NG::Portal::Main::Constants qw(PE_OK);
16
17         our $VERSION = '0.1';
18
19         extends 'Lemonldap::NG::Common::Module';
20
21         sub init {
22             ...
23         }
24
25         sub getUser {
26             my ( $self, $req, %args ) = @_;
27             ...
28         }
29
30         sub setSessionInfo {
31             my ( $self, $req ) = @_;
32             ...
33         }
34
35         sub setGroups {
36             my ( $self, $req ) = @_;
37             ...
38         }
39

DESCRIPTION

41       UserDB modules are used to search a user in user database. UserDB
42       modules are independent objects that are instantiated by Lemonldap::NG
43       portal. They must provide methods described below.
44

METHODS

46   Accessors and methods provided by Lemonldap::NG::Common::Module
47       p: portal object
48       conf: configuration hash (as reference)
49       logger alias for p->logger accessor
50       userLogger alias for p->userLogger accessor
51       error: alias for p->error method
52
53       "Routes" management
54
55       Like any module that inherits from Lemonldap::NG::Portal::Plugin,
56       Lemonldap::NG::Portal::Main::Auth provides URI path functions:
57
58       addAuthRoute: wrapper to Lemonldap::NG::Handler::PSGI::Try
59       addAuthRoute() method
60       addUnauthRoute: wrapper to Lemonldap::NG::Handler::PSGI::Try
61       addUnauthRoute() method
62
63       Example:
64
65         sub init {
66             ...
67             $self->addAuthRoute( saml => { proxy => "proxySub" }, [ 'GET', 'POST' ] );
68             ...
69         }
70         sub proxySub {
71             my ( $self, $req ) = @_;
72             ...
73             # This sub must return a PSGI response. Example
74             return [ 302, [ Location => 'http://x.y/' ], [] ];
75         }
76
77       This means that requests http://auth.../saml/proxy will be given to
78       proxySub() method.
79
80   Methods that must be provided by a UserDB module
81       init()
82
83       Method launched after object creation (after each configuration
84       reload). It must return a true value if authentication module is ready,
85       false else.
86
87       Methods called at each request
88
89       All these methods must return a Lemonldap::NG::Portal::Main::Constants
90       value.  They are called with one argument: a
91       Lemonldap::NG::Portal::Main::Request object.
92
93       Note: if you want to change process() next steps, you just have to
94       change $req->steps array.
95
96       getUser($req,%args)
97
98       First method called to search user in database. If $args{useMail} is
99       set then $req->{user} contains a mail address.
100
101       setSessionInfo($req)
102
103       This method is called after authentication process. It must populate
104       $req->sessionInfo.
105
106       setGroups($req)
107
108       This method populates $req->{sessionInfo}->{groups} if backend is able
109       to provide groups (Like LDAP). Else, it juste return PE_OK.
110

LOGGING

112       Logging is provided by $self->logger and $self->userLogger. The
113       following rules must be applied:
114
115       logger->debug: technical debugging messages
116       logger->info: simple technical information
117       logger->notice: technical information that could interest
118       administrators
119       logger->warn: technical warning
120       logger->error: error that must be reported to administrator
121       userLogger->info: simple information about user's action
122       userLogger->notice: information that may be registered (auth
123       success,...)
124       userLogger->warn: bad action of a user (auth failure). Auth/Combination
125       transform it to "info" when another authentication scheme is available
126       userLogger->error: bad action of a user that must be reported, (even if
127       another backend is available with Combination)
128

AUTHORS

130       LemonLDAP::NG team <http://lemonldap-ng.org/team>
131

BUG REPORT

133       Use OW2 system to report bug or ask for features:
134       <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues>
135

DOWNLOAD

137       Lemonldap::NG is available at <https://lemonldap-ng.org/download>
138
140       See COPYING file for details.
141
142       This library is free software; you can redistribute it and/or modify it
143       under the terms of the GNU General Public License as published by the
144       Free Software Foundation; either version 2, or (at your option) any
145       later version.
146
147       This program is distributed in the hope that it will be useful, but
148       WITHOUT ANY WARRANTY; without even the implied warranty of
149       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
150       General Public License for more details.
151
152       You should have received a copy of the GNU General Public License along
153       with this program.  If not, see <http://www.gnu.org/licenses/>.
154
155
156
157perl v5.38.0                      2023-11-14  Lemonldap::NG::Portal::UserDB(3)
Impressum