Last modified by jhurst on 2024/04/02 14:26

Show last authors
1 **Configuration**
2
3 Installation of an OpenID Connect authentication valve for DigDash
4
5 **Contents**
6
7 {{toc/}}
8
9 = Prerequisites =
10
11 * The acronyms used later are referenced in the glossary at the end of this document.
12 * Having configured the DigDash server with an SSL / TLS (HTTPS) connector (this authentication method requires secure exchanges)
13 * Have the **<digdash_installation> / add-ons / valve_openidconnect folder** containing all the files necessary for setting up the OpenID Connect authentication valve in the DigDash Tomcat server. The placement of these files is described in this document.
14 ** The apache-tomcat folder: transposed to **<digdash_install> / apache-tomcat**
15 *** The lib sub-folder: libraries and log configuration file to be placed in **<digdash_install> / apache-tomcat / lib**
16 *** The webapps sub-folder: the DigDash entry point (endpoint) in a .war to place in **<digdash_install> / apache-tomcat / webapps**
17 * The following operations are to be performed on the **stopped** DigDash server .
18
19 * The user to be authenticated must exist at both the OP and in the LDAP DigDash.
20 ** //**It is therefore advisable to have at least one user having the rights to add DigDash users in the LDAP DigDash before installing the OpenID Connect valve, this in order to avoid SSO authentication failures from the first connections for cause of absence of such user in LDAP.**//
21
22 = Configuration of the DigDash server =
23
24 == Copy of libraries ==
25
26 Add the libraries and the log configuration file from the **apache-tomcat / lib** folder to the folder
27
28 **<digdash_installation> / apache / lib** :
29
30 |oidc-valve.jar|slf4j-log4j12-1.7.7.jar
31 |slf4j-api-1.7.12.jar|log4j.properties
32 |log4j-1.2.15.jar|
33
34 __Libraries in the apache-tomcat / lib folder__
35
36 == Addition of the OpenID Connect authentication valve ==
37
38 Add the OpenID Connect authentication valve in the **server.xml** file located in the folder
39
40 <digdash_installation> / apache-tomcat / conf
41
42 To do this, add the following Valve element in the **Host** element .
43
44 {{code language="XML"}}
45 <Server ... >
46 ...
47 <Host ... >
48 <Valve className = "org.bsworks.catalina.authenticator.oidc.OpenIDConnectSSOValve"
49 allowAddr = "localhost, 127.0.0. *, 0: 0: 0: 0 : 0: 0: 0: 1 "
50 sharedPasswd = " secret "
51 redirect_url = " https: // localhost: 8443 / digdash_oidc_endpoint / oidcendpoint "
52 providers = " [
53 {
54 name: OpenID Provider name,
55 issuer: issuer,
56 clientId: clientId,
57 clientSecret: clientSecret
58 }
59 ] "
60 usernameClaim = " email "
61 additionalScopes = " email "
62 />
63 ...
64 </Host>
65 ...
66 </Server>
67 {{/code}}
68
69 Invariable value
70
71 Variable value depending on the installation
72
73 Extract from the server.xml file
74
75 |Attributes|Description
76 |(% style="color:#e74c3c" %)className //(required)//     |Name of the Java class, implementing the org.apache.catalina.Valve interface, to use as Valve here. This attribute is mandatory because it allows you to select the Valve to use. There are indeed several implementations provided by Tomcat.
77 |(% style="color:#27ae60" %)allowAddr //(required)//     |Server IP address.
78 |(% style="color:#27ae60" %)allowedCtxPath //(optional)//     |Optional, is "/ adminconsole" by default; it is the path of the context whose resources are authorized to pass the valve, useful when the adminconsole is named differently. Example: allowedCtxPath = "/ customadminconsole"
79 |(% style="color:#27ae60" %)sharedPasswd //(required)//     |The shared password and verified at authentication (see point II.5)
80 |(% style="color:#27ae60" %)redirect_url //(required)//     |This is the path of the application to which users will be redirected after authenticating with the OP. For DigDash, the URL will always be [[https: ~~/~~/>>path:https:]] <IPaddress>: <port> / digdash_oidc_endpoint / oidcendpoint
81 |(% style="color:#27ae60" %)cookieTimeOut //(optional)//     |(((
82 Optional, this is the time (in seconds) after which the SSO cookie will expire. Worth 1800 seconds (30 minutes) by default.
83 Otherwise, the cookie will expire after the number of seconds mentioned.
84
85 Example: cookieTimeOut = "3600" (1 hour)
86 )))
87 |(% style="color:#27ae60" %)print_debug //(optional)//     |Optional, is false by default, otherwise add print_debug = "true" for more verbose traces.
88 |providers //(required)//     |(((
89 Array form value of objects in JSON. Each element corresponds to an OpenID Provider used by the application.
90
91 The syntax differs from the standard JSON format in that double quotes are not used for the names of properties and their values ​​(so as to make the format more XMLian). A value can be surrounded by single quotes if it contains separators such as a comma, braces, or spaces. Each object representing a PO has the following properties:
92
93 - **issuer ** //(mandatory) // : This is the only one with a unique URL to identify the OP.    
94
95 * - **name ** //(optional) // : A name associated with the PO; if not by default.(((
96 - **clientId ** //(mandatory): // The client ID associated with the application at the PO.
97
98 - **clientSecret ** //(optional) // : The Secret client. Note that most POs require a Secret client, especially for calls to PO entry points. However, some OPs support public clients, hence the absence of a Secret client.
99
100 - **usernameClaim ** //(optional): // The user Identifier attribute requested by the RP and returned by the OP to identify the user who authenticates.
101
102 - **additionalScopes ** //(optional) // : Additional scopes with an 'openid' scope separated by spaces.
103 )))
104 )))
105 |usernameClaim //(optional)//     |The default User Identifier used by all OPs which do not specify one in the proper properties of the OP.
106 |additionalScopes //(optional)//     |The default additional scopes used by all OPs which do not specify one in the proper properties of the OP.
107 |httpConnectTimeout //(optional)//     |Timeout in milliseconds for establishing the connection to the OP. 5000 ms (5 seconds) by default.
108 |httpReadTimeout //(optional)//     |Timeout in milliseconds for reading data received from the OP. 5000 ms (5 seconds) by default.
109
110 __Table describing the attributes of the Vavle element__
111
112 == Addition of the .war corresponding to the entry point of the Relying Party ==
113
114 Add the **digdash_oidc_endpoint.war** archive from the **apache-tomcat / webapps** folder to the folder
115
116 **<digdash_installation> / apache-tomcat / webapps** .
117
118 It is the entry point (endpoint) of the RP accessed by the PO.
119
120 == Addition of security constraints ==
121
122 Add the security constraints to the **web.xml** file located in the folder
123
124 **<digdash_installation> / apache-tomcat / conf** .
125
126 {{code}}
127 <web-app ... >
128 ...
129 <security-role>
130 <role-name> CUSTOM </role-name>
131 </security-role>
132
133 <security-constraint>
134 <display-name> CUSTOM Security Constraint </ display -name>
135 <web-resource-collection>
136 <web-resource-name> Protected Area </web-resource-name>
137 <url-pattern> / * </url-pattern>
138 </web-resource-collection>
139 <auth -constraint>
140 <role-name> CUSTOM </role-name>
141 </auth-constraint>
142 </security-constraint>
143
144 <security-constraint>
145 <web-resource-collection>
146 <web-resource-name> Non-Protected Area</web-resource-name>
147 <url-pattern> / vjdbc </url-pattern>
148 </web-resource-collection>
149 </security-constraint>
150 ...
151 </web-app>
152 {{/code}}
153
154 __Extract from web.xml file__
155
156 == Server URL and domain for the Dashboard ==
157
158 It may be necessary, and **it is advisable** to specify on which server / domain the Dashboard will rely.
159
160 To do this, modify in the **web.xml** file in
161
162 **<digdash_installation> / apache-tomcat / webapps / digdash_dashboard / WEB-INF.**
163
164 To force the domain, change the value of the **FORCEDOMAIN** parameter to //true// .
165 Mention the domain name by changing the **DOMAIN** parameter .
166
167 To force the server address, change the value of the ** FORCEURLSERVER ** parameter to //true// . ** **Mention the server address by changing the **SERVERURL** parameter .
168
169 {{code}}
170 <web-app ... >
171 ...
172 <servlet>
173 <servlet-name> dashServlet </servlet-name>
174 <servlet-class> com.digdash.server.DigdashServiceImpl </servlet-class>
175 ...
176 <init- param>
177 <param-name> DOMAIN </param-name>
178 <param-value> ddenterpriseapi </param-value>
179 </init-param>
180 <init-param>
181 <param-name> FORCEDOMAIN </param-name>
182 < param-value> true </param-value>
183 </init-param>
184 <init-param>
185 <param-name> SERVERURL </ param-name>
186 <param-value> http: // localhost: 8080</param-value>
187 </init-param>
188 <init-param>
189 <param-name> FORCESERVERURL </param-name>
190 <param-value> true </param-value>
191 </init-param>
192 ...
193 </servlet>
194 ...
195 </web-app>
196 {{/code}}
197
198 __Extract from web.xml file__
199 Variable value depending on the installation
200
201 |(((
202 * [[image:http://rack-lure:8585/bin/download/Digdash_2019R2/others_documents/config_auth_oidc/WebHome/config_auth_oidc_fr_html_829eaa34e529ef0c.png?width=72&height=72&rev=1.1||alt="config_auth_oidc_fr_html_829eaa34e529ef0c.png"]]
203 )))|(((
204 * The example value for the SERVERURL parameter will almost always refer to localhost, when the dashboard and the server are placed in the same Tomcat server, which represents almost 99% of the uses. It will naturally be necessary to refer to the address of the external server if these two elements are placed on different servers.
205 )))
206
207 |[[image:http://rack-lure:8585/bin/download/Digdash_2019R2/others_documents/config_auth_oidc/WebHome/config_auth_oidc_fr_html_829eaa34e529ef0c.png?width=72&height=72&rev=1.1||alt="config_auth_oidc_fr_html_829eaa34e529ef0c.png"]]
208 |(((
209 * This parameter can be edited via the web.xml file as indicated above. This file is specific to each installation of DigDash. You can enter this parameter more generally in the file(((
210 **<user> / Application Data / Enterprise Server / dashboard_system.xml **
211
212 For more information, you can refer to the DigDash documentation “guide_avance_systeme_fr.pdf”.
213 )))
214 )))
215
216 == Changing the value of the sharedPasswd parameter ==
217
218 Change the value of the //sharedPasswd// parameter (secret value below to change) in the **web.xml** file of Dashboard in the folder
219
220 **<digdash_installation> / apache-tomcat / webapps / digdash_dashboard / WEB-INF** .
221
222 The value must correspond to that mentioned in the //sharedPasswd// attribute in the valve of the file
223
224 **<digdash_installation> /apache-tomcat/conf/server.xml** (see part II.2).
225
226 {{code}}
227 <web-app ... >
228 ...
229 <servlet>
230 <servlet-name> dashServlet </servlet-name>
231 <servlet-class> com.digdash.server.DigdashServiceImpl </servlet-class>
232 ...
233 <init- param>
234 <param-name> sharedPasswd </param-name>
235 <param-value> secret </param-value>
236 </init-param>
237 ...
238 </servlet>
239 ...
240  </web-app>
241 {{/code}}
242
243 Variable value depending on the installation
244
245
246 __Extract from the server.xml file__
247
248 == Modification of the authentication method ==
249
250 Modify the authentication method (LDAP is the default method) in the **web.xml** file located in the folder
251
252 **<digdash_installation> / apache-tomcat / webapps / ddenterpriseapi / WEB-INF** .
253
254 "External" means that safety is managed by the valve configured above.
255
256 {{code language="XML"}}
257 <web-app ... >
258 ...
259 <servlet>
260 ...
261 </servlet>
262 ...
263 <servlet>
264 <description> </description>
265 <display-name> DDEnterpriseAuthServlet </display-name>
266 <servlet-name > DDEnterpriseAuthServlet </servlet-name>
267 <servlet-class> com.digdash.server.DDEnterpriseAuthServlet </servlet-class>
268 <init-param>
269 <param-name> authMethod </param-name>
270 <param-value> External < / param-value>
271 </init-param>
272 ...
273 </servlet>
274 ...
275  </web-app>
276 {{/code}}
277
278 __Extract from web.xml file__
279
280 = OpenID Provider configuration =
281
282 The OP must register DigDash as a RP in its list of RPs for DigDash to be able to take advantage of Single Sign-On.
283
284 Also, the OP will have to enter the callback URL to identify the entry point of the DigDash application. The URL will be of the form
285
286 https: ~/~/ <IP address>: <port> / digdash_oidc_endpoint / oidcendpoint
287
288 = Log level =
289
290 You can customize the log level for the authentication valve.
291
292 By default, only errors are logged. If however you want to have more details on the course of actions and exchanges between the different entities, you can assign the value 'DEBUG' instead of 'ERROR' in the log4j.properties file which was imported into the lib folder of Tomcat .
293
294 log4j.logger.org.bsworks = **ERROR** , stdout
295
296 log4j.logger.org.bsworks = **DEBUG** , stdout
297
298 = OpenID Connect authentication on the Enterprise Studio side =
299
300 To authenticate with OpenID Connect on the Enterprise Studio side, please ensure that you have performed the following actions:
301
302 == Server and domain definitions in the .jnlp file ==
303
304 You can, like the Dashboard, define the server and the domain on which DigDash will rely.
305
306 To do this, modify the end of the digdash.jnlp file in the DigDash installation folder **<digdash_installation> / apache-tomcat / webapps / adminconsole**
307
308 {{code}}
309 < jnlp ...>
310 ...
311 < application-desc main-class = "commandline.CommandLineMain" >
312 < argument > https : // localhost: 8443 </argument> (1)
313 < argument > ddenterpriseapi </ argument > ( 2 )
314 < argument > <% = lang %> </ argument > ( 3 )
315 < argument > <% = dashboard %> </ argument > ( 4)
316 < argument > - AuthMode = External </ argument > ( 5 )
317 < argument > - SSLNoPathCheck </ argument > ( A )
318 ...
319 </ application - desc >
320 </ jnlp >
321 {{/code}}
322
323 __Extract from the digdash.jnlp file__
324
325 __**Warning**__** **: the arguments noted (1), (2), (3), (4), (5) must not change order.
326
327 Argument (1): the address of the DigDash server; variable depending on your installation
328
329 Argument (2): the name of the DigDash domain; variable depending on your installation
330
331 Argument (5): The authentication method; External, mandatory
332
333 Argument (A): optional argument, sometimes necessary in the case of SSL, HTTPS connections.
334
335 == Connection to DigDash Enterprise Studio ==
336
337 Download and run the .jnlp by going to the DigDash home page in the Enterprise Studio section.
338
339 [[image:1592471261704-499.png||height="306" width="622"]]
340
341 An authentication window should appear with the IdP authentication target.
342
343 In this document, Google is the OP that we have chosen to illustrate our examples.
344
345 [[image:http://rack-lure:8585/bin/download/Digdash_2019R2/others_documents/config_auth_oidc/WebHome/config_auth_oidc_fr_html_4273fd0e30eb8463.png?width=632&height=388&rev=1.1||alt="config_auth_oidc_fr_html_4273fd0e30eb8463.png"]]
346 \\
347
348 __Capture: test pattern with Google OP authentication form__
349
350 The user will have to enter his connection data and if he has been authenticated with the OP and that he corresponds to an existing user in the LDAP DigDash, the authentication will have succeeded and the window will attest to the success of the authentication.
351
352 [[image:http://rack-lure:8585/bin/download/Digdash_2019R2/others_documents/config_auth_oidc/WebHome/config_auth_oidc_fr_html_6230a5f637fd4c54.png?width=608&height=372&rev=1.1||alt="config_auth_oidc_fr_html_6230a5f637fd4c54.png"]]
353 \\
354
355 __Capture: window of successful authentication__
356
357 The window will close automatically, then Enterprise Studio will start loading to launch.
358
359 = Lexicon =
360
361 * We will call in this document:
362 ** SSO: Single Sign On or Single Authentication; OpenIDConnect is an SSO method(((
363 OP: OpenID Provider or the Identity Provider
364
365 PR: the Relying Party or the Service Provider (DigDash)
366
367 Endpoint: Entry point
368 )))
369
370 = References =
371
372 https:~/~/www.oasis-open.org
373
374 //DigDash uses the OpenSource tomcat8-oidcauth library from Boyle Software, Inc. to support the OpenID Connect authentication method.//
375
376 https:~/~/www.boylesoftware.com/
377
378 https:~/~/github.com/boylesoftware/tomcat8-oidcauth
379
380