Debian Codegraph @

doc/sources/admin/authchoice.rst

raw
1 Backend choice by users
2 =======================
3
4 ============== ===== ========
5 Authentication Users Password
6 ============== ===== ========
7 ✔ ✔ ✔
8 ============== ===== ========
9
10 Presentation
11 ------------
12
13 By default, only the configured authentication backend is available for
14 users.
15
16 Contrary to :doc:`multiple backend stacking<authmulti>`, backend choice
17 will present all available authentication methods to users, who will
18 choose the one they want.
19
20 The choice will concern three backends:
21
22 - Authentication
23 - Users
24 - Password
25
26 The chosen backends will be registered in session:
27
28 - ``$_auth``
29 - ``$_userDB``
30 - ``$_passwordDB``
31
32 Authentication choice will also be registered in session:
33
34 - ``$_authChoice``
35
36 Configuration
37 -------------
38
39 In Manager, go in ``General Parameters`` > ``Authentication modules``
40 and choose Choice for authentication.
41
42
43 .. attention::
44
45 When ``Choice`` is selected for authentication, values
46 for Users and Password modules are also forced to ``Choice``.
47
48 Then, go in ``Choice Parameters``:
49
50 - **URL parameter**: parameter name used to set choice value (default:
51 ``lmAuth``)
52 - **Allowed modules**: click on ``New chain`` to add a choice.
53 - **Choice used for password authentication**: authentication module used by
54 :doc:`AuthBasic handler<authbasichandler>` and :ref:`OAuth2.0 Password Grant <resource-owner-password-grant>`
55 - **FindUser plugin parameter**: authentication module called by
56 Find user plugin (:doc:`Find user plugin<finduser>`)
57 - **Auto-select only method**: if only one authentication method is available, automatically select it
58
59 |image0|
60
61 Define here:
62
63 - **Name**: Text displayed on choice tab.
64 - **Authentication module**
65 - **Users module**
66 - **Password module**
67 - **URL**: optional, can be used to redirect on another URL (for
68 example https://authssl.example.com). This is mandatory if you want
69 to use an Apache authentication module, which is run by Apache before
70 showing the LemonLDAP::NG portal page.
71 - **Condition**: optional, can be used to evaluate an expression to
72 display the tab. For example, to display a tab only if redirected by
73 Handler from application ``test1.example.com``, you can set this
74 condition:
75
76 .. code-block:: perl
77
78 $env->{urldc} =~ /test1\.example\.com/
79
80 .. versionchanged:: 2.20.0
81
82 Starting with version *2.20.0*, you can use the same syntax as :doc:`regular
83 rules <rules_examples>`. In addition to the following special variables
84
85 * ``$targetAuthnLevel``: authentication level requested by the current application
86
87
88 Ordering of choices on the main login page
89 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90
91 You can prefix the key name with a digit to order them. The
92 digit will not be shown on portal page. Underscore characters are also
93 replaced by spaces.
94
95 For example, use ``2_France_Connect`` to use *France Connect* as the second
96 choice.
97
98 Parameter override
99 ~~~~~~~~~~~~~~~~~~
100
101 You can also override some LLNG parameters for each chain. See
102 :doc:`Parameters list<parameterlist>` to have the key names to use
103
104 Custom logo
105 ~~~~~~~~~~~
106
107 You can customize the logo by copying a PNG file that matches the *Name* of the
108 choice in ``/usr/share/lemonldap-ng/portal/htdocs/static/common/modules/``.
109
110 For example: ``2_France_Connect.png``
111
112 Issues with persistent data
113 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
114
115 Federated authentication need pdata cookie.
116 SameSite cookie value must be set to "Lax" or "None".
117 See :doc:`SSO cookie parameters<ssocookie>`
118
119 Authentication request to another URL than Portal URL can lead
120 to a persistent loop between Portal and a redirection URL (pdata is not
121 removed because domains mismatch). To avoid this, you have to set pdata
122 cookie domain by editing ``lemonldap-ng.ini`` in section [portal]:
123
124 .. code:: ini
125
126 [portal]
127 pdataDomain = example.com
128
129
130 .. |image0| image:: /documentation/manager-choice.png
131 :class: align-center
132