Debian Codegraph @

doc/sources/admin/oidc-proconnect.rst

raw
1 ProConnect
2 ==========
3
4 |image0|
5
6 Presentation
7 ------------
8
9 `ProConnect <https://agentconnect.gouv.fr/>`__ is an
10 authentication platform made by French government.
11 It relies on OpenID Connect protocol.
12
13 To select on which Identity Provider the user will be redirected,
14 ProConnect relies on the email domain.
15
16 .. tip::
17
18 All users of an email domain will use the same Identity Provider.
19
20
21 LemonLDAP::NG can be used as Relying Party or OpenID Provider for ProConnect.
22
23 Official documentation is available on `partner website <https://partenaires.proconnect.gouv.fr/docs>`__.
24
25 LL::NG as OpenID Provider
26 -------------------------
27
28 Registration on ProConnect
29 ^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 You need to `fill a form <https://www.demarches-simplifiees.fr/commencer/demande-creation-fi-fca>`__ to request the authorization of using ProConnect.
32
33 You will provide one or more mail domains that will be associated with your Identity Provider.
34
35 Once the configuration is done on LL::NG, you will send them the client ID, client secret and OIDC metadata URL.
36
37 Configuration on LemonLDAP::NG
38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
40 Add ProConnect as Relying Party, with these options:
41
42 * Client ID / Client Secret: generate random values
43 * Redirect URIs: https://auth.agentconnect.gouv.fr/api/v2/oidc-callback
44 * Redirect Logout URIs: https://auth.agentconnect.gouv.fr/api/v2/client/logout-callback
45 * Exported attributes:
46
47 * email (mandatory)
48 * usual_name (mandatory): family name
49 * given_name (mandatory): first name
50 * siret (mandatory)
51 * uid (mandatory): must contain only ASCII characters, can be any unique and persistent attribute
52 * name
53 * organizational_unit (must not contain some special characters, listed in this regex `/^[^.*?{}()|[\]\t\r\n\\]*$/`)
54 * phone
55 * preferred_username
56
57 * User attribute: same attribute as uid
58 * ID Token signature algorithm: RS256
59 * UserInfo response format: JWT/RS256
60 * Scope / Scope value contents:
61
62 * given_name: given_name
63 * organizational_unit: organizational_unit
64 * phone: phone
65 * siret: siret
66 * uid: uid
67 * usual_name: usual_name
68
69 To match authencation levels required by ProConnect, you must adapt the
70 corresponding levels in `OpenID Connect Service` > `Authentication context`. Add one entry for each authentication level used in your LemonLDAP sessions. For example:
71
72 * ``eidas1`` => ``2``
73 * ``eidas1-mfa`` => ``3``
74 * ``eidas2`` => ``5``
75
76 You need to define at least the ``eidas1`` level.
77
78 .. tip::
79 For test platform, you need to use the URLs listed on `this page <https://partenaires.proconnect.gouv.fr/docs/ressources/valeur_ac_domain>`__.
80
81 .. tip::
82
83 If you want to send the same SIRET number for all your users, but don't have a dedicated field for it in your user backend, you can use a macro:
84
85
86 OpenID Connect Relying Parties » rp-proconnect » Exported attributes
87
88 * Claim name: ``siret``
89 * Variable name: ``siret`` (doesn't have to exist in your session)
90
91 OpenID Connect Relying Parties » rp-proconnect » Macros
92
93 * Key: ``siret``
94 * Value: ``"12345678901234"`` (don't omit the quotes)
95
96 Configuration with CLI
97 ^^^^^^^^^^^^^^^^^^^^^^
98
99 If you want to configure it through CLI, you can adapt the following commands.
100
101 * Main paarameters
102
103 ::
104
105 /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -yes 1 \
106 addKey \
107 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsAccessTokenExpiration 120 \
108 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsClientID client-id-for-proconnect \
109 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsClientSecret client-secret-for-proconnect \
110 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsIDTokenExpiration 3600 \
111 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsIDTokenSignAlg RS256 \
112 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsPostLogoutRedirectUris https://auth.agentconnect.gouv.fr/api/v2/client/logout-callback \
113 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsRedirectUris https://auth.agentconnect.gouv.fr/api/v2/oidc-callback \
114 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsUserIDAttr uid \
115 oidcRPMetaDataOptions/rp-proconnect oidcRPMetaDataOptionsUserInfoSignAlg RS256
116
117
118 * Attributes
119
120 ::
121
122 /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -yes 1 \
123 addKey \
124 oidcRPMetaDataExportedVars/rp-proconnect email mail \
125 oidcRPMetaDataExportedVars/rp-proconnect given_name givenName \
126 oidcRPMetaDataExportedVars/rp-proconnect name cn \
127 oidcRPMetaDataExportedVars/rp-proconnect organizational_unit ou \
128 oidcRPMetaDataExportedVars/rp-proconnect phone telephoneNumber \
129 oidcRPMetaDataExportedVars/rp-proconnect preferred_username displayName \
130 oidcRPMetaDataExportedVars/rp-proconnect siret deparmentNumber \
131 oidcRPMetaDataExportedVars/rp-proconnect uid uid \
132 oidcRPMetaDataExportedVars/rp-proconnect usual_name sn
133
134 * Extra scopes (only needed if you did not configure LL::NG to automatically send all exported attributes by default)
135
136 ::
137
138 /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -yes 1 \
139 addKey \
140 oidcRPMetaDataOptionsExtraClaims/rp-proconnect given_name given_name \
141 oidcRPMetaDataOptionsExtraClaims/rp-proconnect organizational_unit organizational_unit \
142 oidcRPMetaDataOptionsExtraClaims/rp-proconnect phone phone \
143 oidcRPMetaDataOptionsExtraClaims/rp-proconnect siret siret \
144 oidcRPMetaDataOptionsExtraClaims/rp-proconnect uid uid \
145 oidcRPMetaDataOptionsExtraClaims/rp-proconnect usual_name usual_name
146
147
148 LL::NG as Relying Party
149 -----------------------
150
151 Registration on ProConnect
152 ^^^^^^^^^^^^^^^^^^^^^^^^^^
153
154 Use the `partner website <https://partenaires.proconnect.gouv.fr/>`__ to declare your application in test.
155 Production needs a DataPass request.
156
157 Fill these informations:
158
159 * Application name
160 * Login URL: your portal URL with the OIDC callback parameter, for example: ``https://auth.example.com/?openidconnectcallback=1``
161 * Logout URL: your portal URL with logout parameter, for example: ``https://auth.example.com/?logout=1``
162 * Signature algorithm: use recommanded values, for example RS256
163
164 Copy client ID and client secret, they are required to configure ProConnect OpenID Provider on LL::NG.
165
166 Configuration on LemonLDAP::NG
167 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168
169 Add ProConnect as OpenID Provider, with these options:
170
171 * Metadata: get metadata from `test <https://fca.integ01.dev-agentconnect.fr/api/v2/.well-known/openid-configuration>`__ or `production <https://auth.agentconnect.gouv.fr/api/v2/.well-known/openid-configuration>`__
172 * Exported attributes:
173
174 * givenName: given_name
175 * idp_id: idp_id
176 * mail: email
177 * siret: siret
178 * sn: usual_name
179 * telephoneNumber: phone_number
180 * uid: uid
181
182 * Options:
183
184 * Configuration:
185
186 * Store ID Token: On (required for logout)
187 * Configuration endpoint: set metadata URL
188 * Client ID/Client Secret: put values given by ProConnect
189
190 * Protocol:
191
192 * Scope: openid given_name usual_name email uid siret idp_id phone
193
194 Configuration with CLI
195 ^^^^^^^^^^^^^^^^^^^^^^
196
197 If you want to configure it through CLI, you can adapt the following commands.
198
199 * Metadata (adapt URL to test or production)
200
201 ::
202
203 curl https://auth.agentconnect.gouv.fr/api/v2/.well-known/openid-configuration > /tmp/metadata-proconnect.json
204
205 /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -yes 1 \
206 addKey \
207 oidcOPMetaDataJSON op-proconnect `cat /tmp/metadata-proconnect.json`
208
209 * Attributes
210
211 ::
212
213 /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -yes 1 \
214 addKey \
215 oidcOPMetaDataExportedVars/op-proconnect givenName given_name \
216 oidcOPMetaDataExportedVars/op-proconnect idp_id idp_id \
217 oidcOPMetaDataExportedVars/op-proconnect mail email \
218 oidcOPMetaDataExportedVars/op-proconnect siret siret \
219 oidcOPMetaDataExportedVars/op-proconnect sn usual_name \
220 oidcOPMetaDataExportedVars/op-proconnect telephoneNumber phone_number \
221 oidcOPMetaDataExportedVars/op-proconnect uid uid
222
223
224 * Options (replace client ID, client secret and metadata URL)
225
226 ::
227
228 /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -yes 1 \
229 addKey \
230 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsAuthnEndpointAuthSigAlg RS256 \
231 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsCheckJWTSignature 1 \
232 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsClientID <client ID> \
233 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsClientSecret <cliebt secret> \
234 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsConfigurationURI <metadata URL> \
235 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsIDTokenMaxAge 30 \
236 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsJWKSTimeout 0 \
237 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsMaxAge 0 \
238 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsNoJwtHeader 0 \
239 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsRequirePkce 0 \
240 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsScope openid given_name usual_name email uid siret idp_id phone custom \
241 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsStoreIDToken 1 \
242 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsTokenEndpointAuthMethod client_secret_post \
243 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsUseNonce 1 \
244 oidcOPMetaDataOptions/op-proconnect oidcOPMetaDataOptionsUserinfoSource userinfo
245
246 .. |image0| image:: /applications/proconnect.svg
247 :class: align-center
248 :width: 300px