Last modified by jhurst on 2021/04/21 10:01

Hide last authors
Aurelie Bertrand 5.3 1 **Configuration**
michelhc 5.1 2
Aurelie Bertrand 5.3 3 Installation of an OpenID Connect authentication valve for DigDash
michelhc 5.1 4
Aurelie Bertrand 5.3 5 **Contents**
michelhc 5.1 6
Aurelie Bertrand 5.3 7 {{toc/}}
michelhc 5.1 8
Aurelie Bertrand 5.3 9 = Prerequisites =
michelhc 5.1 10
Aurelie Bertrand 5.3 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 .
michelhc 5.1 18
Aurelie Bertrand 5.3 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.**//
michelhc 5.1 21
Aurelie Bertrand 5.3 22 = Configuration of the DigDash server =
michelhc 5.1 23
Aurelie Bertrand 5.3 24 == Copy of libraries ==
michelhc 5.1 25
Aurelie Bertrand 5.3 26 Add the libraries and the log configuration file from the **apache-tomcat / lib** folder to the folder
michelhc 5.1 27
Aurelie Bertrand 5.3 28 **<digdash_installation> / apache / lib** :
michelhc 5.1 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
Aurelie Bertrand 5.3 34 __Libraries in the apache-tomcat/lib folder__
michelhc 5.1 35
Aurelie Bertrand 5.3 36 == Addition of the OpenID Connect authentication valve ==
michelhc 5.1 37
Aurelie Bertrand 5.3 38 Add the OpenID Connect authentication valve in the **server.xml** file located in the folder
39
michelhc 5.1 40 <digdash_installation>/apache-tomcat/conf
41
Aurelie Bertrand 5.3 42 To do this, add the following Valve element in the **Host** element .
michelhc 5.1 43
Aurelie Bertrand 5.3 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 ></Valve>
63 ...
64 </Host>
65 ...
66 </Server>
michelhc 5.1 67 {{/code}}
68
Aurelie Bertrand 5.3 69 __Extract from the server.xml file__
michelhc 5.1 70
Aurelie Bertrand 5.3 71 Value for parameter className is invariable.
72 Values for parameters allowAddr, sharedPasswd, redirect_url, providers, usernameClaim, additionalScopes are variable according to the installation.
michelhc 5.1 73
74
Aurelie Bertrand 5.3 75 |(% style="width:201px" %)Attributes|(% style="width:1219px" %)Description
76 |(% style="color:#e74c3c; width:201px" %)className //(required)//     |(% style="width:1219px" %)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; width:201px" %)allowAddr //(required)//     |(% style="width:1219px" %)Server IP address.
78 |(% style="color:#27ae60; width:201px" %)allowedCtxPath //(optional)//     |(% style="width:1219px" %)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; width:201px" %)sharedPasswd //(required)//     |(% style="width:1219px" %)The shared password and verified at authentication (see point II.5)
80 |(% style="color:#27ae60; width:201px" %)redirect_url //(required)//     |(% style="width:1219px" %)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; width:201px" %)cookieTimeOut //(optional)//     |(% style="width:1219px" %)(((
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.
michelhc 5.1 84
Aurelie Bertrand 5.3 85 Example: cookieTimeOut = "3600" (1 hour)
michelhc 5.1 86 )))
Aurelie Bertrand 5.3 87 |(% style="color:#27ae60; width:201px" %)print_debug //(optional)//     |(% style="width:1219px" %)Optional, is false by default, otherwise add print_debug = "true" for more verbose traces.
88 |(% style="width:201px" %)providers //(required)//     |(% style="width:1219px" %)(((
89 Array form value of objects in JSON. Each element corresponds to an OpenID Provider used by the application.
michelhc 5.1 90
Aurelie Bertrand 5.3 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:
michelhc 5.1 92
Aurelie Bertrand 5.3 93 - **issuer **//(mandatory) // : This is the only one with a unique URL to identify the OP.    
michelhc 5.1 94
Aurelie Bertrand 5.3 95 - **name **//(optional) // : A name associated with the PO; if not by default.
michelhc 5.1 96
97 (((
Aurelie Bertrand 5.3 98 - **clientId **//(mandatory): // The client ID associated with the application at the PO.
michelhc 5.1 99
Aurelie Bertrand 5.3 100 - **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.
michelhc 5.1 101
Aurelie Bertrand 5.3 102 - **usernameClaim **//(optional): // The user Identifier attribute requested by the RP and returned by the OP to identify the user who authenticates.
michelhc 5.1 103
Aurelie Bertrand 5.3 104 - **additionalScopes **//(optional) // : Additional scopes with an 'openid' scope separated by spaces.
michelhc 5.1 105 )))
106 )))
Aurelie Bertrand 5.3 107 |(% style="width:201px" %)usernameClaim //(optional)//     |(% style="width:1219px" %)The default User Identifier used by all OPs which do not specify one in the proper properties of the OP.
108 |(% style="width:201px" %)additionalScopes //(optional)//     |(% style="width:1219px" %)The default additional scopes used by all OPs which do not specify one in the proper properties of the OP.
109 |(% style="width:201px" %)httpConnectTimeout //(optional)//     |(% style="width:1219px" %)Timeout in milliseconds for establishing the connection to the OP. 5000 ms (5 seconds) by default.
110 |(% style="width:201px" %)httpReadTimeout //(optional)//     |(% style="width:1219px" %)Timeout in milliseconds for reading data received from the OP. 5000 ms (5 seconds) by default.
michelhc 5.1 111
Aurelie Bertrand 5.3 112 __Table describing the attributes of the Vavle element__
michelhc 5.1 113
Aurelie Bertrand 5.3 114 == Addition of the .war corresponding to the entry point of the Relying Party ==
michelhc 5.1 115
Aurelie Bertrand 5.3 116 Add the **digdash_oidc_endpoint.war** archive from the **apache-tomcat/webapps** folder to the folder
michelhc 5.1 117
Aurelie Bertrand 5.3 118 **<digdash_installation>/apache-tomcat/webapps**.
michelhc 5.1 119
Aurelie Bertrand 5.3 120 It is the entry point (endpoint) of the RP accessed by the PO.
michelhc 5.1 121
Aurelie Bertrand 5.3 122 == Addition of security constraints ==
michelhc 5.1 123
Aurelie Bertrand 5.3 124 Add the security constraints to the **web.xml** file located in the folder
michelhc 5.1 125
Aurelie Bertrand 5.3 126 **<digdash_installation>/apache-tomcat/conf** .
michelhc 5.1 127
Aurelie Bertrand 5.3 128 {{code}}
129 <web-app ... >
130 ...
131 <security-role>
132 <role-name>CUSTOM</role-name>
133 </security-role>
michelhc 5.1 134
Aurelie Bertrand 5.3 135 <security-constraint>
136 <display-name>CUSTOM Security Constraint</display-name>
137 <web-resource-collection>
138 <web-resource-name>Protected Area</web-resource-name>
139 <url-pattern>/*</url-pattern>
140 </web-resource-collection>
141 <auth-constraint>
142 <role-name>CUSTOM</role-name>
143 </auth-constraint>
144 </security-constraint>
michelhc 5.1 145
Aurelie Bertrand 5.3 146 <security-constraint>
147 <web-resource-collection>
148 <web-resource-name>Non-Protected Area</web-resource-name>
149 <url-pattern>/vjdbc</url-pattern>
150 </web-resource-collection>
151 </security-constraint>
152 ...
michelhc 5.1 153 </web-app>
154 {{/code}}
155
Aurelie Bertrand 5.3 156 __Extract from web.xml file__
michelhc 5.1 157
Aurelie Bertrand 5.3 158 == Server URL and domain for the Dashboard and Web Studio ==
michelhc 5.1 159
Aurelie Bertrand 5.3 160 It may be necessary, and **it is advisable** to specify on which server / domain the Dashboard will rely.
michelhc 5.1 161
Aurelie Bertrand 5.3 162 To do this, modify in the **web.xml** file in **<digdash_installation>/apache-tomcat/webapps/digdash_dashboard /WEB-INF.**
michelhc 5.1 163
Aurelie Bertrand 5.3 164 Do the same for the **web.xml** file in **<digdash_installation>/apache-tomcat/webapps/studio/WEB-INF**
michelhc 5.1 165
Aurelie Bertrand 5.3 166 To force the domain, change the value of the **FORCEDOMAIN** parameter to //true// .
167 Mention the domain name by changing the **DOMAIN** parameter .
michelhc 5.1 168
Aurelie Bertrand 5.3 169 To force the server address, change the value of the ** FORCEURLSERVER ** parameter to //true// . ** **Mention the server address by changing the **SERVERURL** parameter .
michelhc 5.1 170
Aurelie Bertrand 5.3 171 {{code}}
172 <web-app ... >
173 ...
174 <servlet>
175 <servlet-name>dashServlet</servlet-name>
176 <servlet-class>com.digdash.server.DigdashServiceImpl</servlet-class>
177 ...
178 <init-param>
179 <param-name>DOMAIN</param-name>
180 <param-value>ddenterpriseapi</param-value>
181 </init-param>
182 <init-param>
183 <param-name>FORCEDOMAIN</param-name>
184 < param-value>true</param-value>
185 </init-param>
186 <init-param>
187 <param-name>SERVERURL</ param-name>
188 <param-value>http://localhost:8080</param-value>
189 </init-param>
190 <init-param>
191 <param-name>FORCESERVERURL</param-name>
192 <param-value>true</param-value>
193 </init-param>
194 ...
195 </servlet>
196 ...
197 </web-app>
michelhc 5.1 198 {{/code}}
199
Aurelie Bertrand 5.3 200 __Extract from web.xml file__
michelhc 5.1 201
Aurelie Bertrand 5.3 202 Values for parameters DOMAIN, FORCEDOAMIN, SERVERUEL, FORCESERVERURL are variable according to the installation.
michelhc 5.1 203
204
Aurelie Bertrand 5.3 205 |(((
206 * [[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"]]
207 )))|(((
208 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.
209 )))
michelhc 5.1 210
Aurelie Bertrand 5.3 211 |[[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"]]
212 |(((
213 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
michelhc 5.1 214
Aurelie Bertrand 5.3 215 (% style="background-color:transparent" %)**<user> / Application Data / Enterprise Server / dashboard_system.xml **
216
michelhc 5.1 217 (((
Aurelie Bertrand 5.3 218 For more information, you can refer to the DigDash documentation “guide_avance_systeme_fr.pdf”.
michelhc 5.1 219 )))
Aurelie Bertrand 5.3 220 )))
michelhc 5.1 221
Aurelie Bertrand 5.3 222 == Changing the value of the sharedPasswd parameter ==
michelhc 5.1 223
Aurelie Bertrand 5.3 224 Change the value of the //sharedPasswd// parameter (secret value below to change) in the **web.xml** file of Dashboard in the folders
michelhc 5.1 225
Aurelie Bertrand 5.3 226 **<digdash_installation>/apache-tomcat/webapps/digdash_dashboard/WEB-INF**
michelhc 5.1 227
Aurelie Bertrand 5.3 228 and
michelhc 5.1 229
Aurelie Bertrand 5.3 230 **<digdash_installation>/apache-tomcat/webapps/studio/WEB-INF**
231
232 The value must correspond to that mentioned in the //sharedPasswd// attribute in the valve of the file
233
234 **<digdash_installation>/apache-tomcat/conf/server.xml** (see part II.2).
235
236 {{code}}
237 <web-app ... >
238 ...
239 <servlet>
240 <servlet-name>dashServlet</servlet-name>
241 <servlet-class>com.digdash.server.DigdashServiceImpl</servlet-class>
242 ...
243 <init-param>
244 <param-name>sharedPasswd</param-name>
245 <param-value>secret</param-value>
246 </init-param>
247 ...
248 </servlet>
249 ...
250  </web-app>
michelhc 5.1 251 {{/code}}
252
Aurelie Bertrand 5.3 253 __Extract from the server.xml file__
michelhc 5.1 254
Aurelie Bertrand 5.3 255 Value for parameter sharedPasswd is variable according to the installation.
michelhc 5.1 256
Aurelie Bertrand 5.3 257 == Modification of the authentication method ==
michelhc 5.1 258
Aurelie Bertrand 5.3 259 Modify the authentication method (LDAP is the default method) in the **web.xml** file located in the folder
michelhc 5.1 260
Aurelie Bertrand 5.3 261 **<digdash_installation>/apache-tomcat/webapps/ddenterpriseapi/WEB-INF** .
michelhc 5.1 262
Aurelie Bertrand 5.3 263 "External" means that safety is managed by the valve configured above.
michelhc 5.1 264
Aurelie Bertrand 5.3 265 {{code language="XML"}}
266 <web-app ... >
267 ...
268 <servlet>
269 ...
270 </servlet>
271 ...
272 <servlet>
273 <description></description>
274 <display-name>DDEnterpriseAuthServlet</display-name>
275 <servlet-name>DDEnterpriseAuthServlet</servlet-name>
276 <servlet-class> com.digdash.server.DDEnterpriseAuthServlet</servlet-class>
277 <init-param>
278 <param-name>authMethod</param-name>
279 <param-value>External</param-value>
280 </init-param>
281 ...
282 </servlet>
283 ...
284  </web-app>
michelhc 5.1 285 {{/code}}
286
Aurelie Bertrand 5.3 287 __Extract from web.xml file__
michelhc 5.1 288
Aurelie Bertrand 5.3 289 = OpenID Provider configuration =
michelhc 5.1 290
Aurelie Bertrand 5.3 291 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.
michelhc 5.1 292
Aurelie Bertrand 5.3 293 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
michelhc 5.1 294
Aurelie Bertrand 5.3 295 https:~/~/<IP address>:<port>/digdash_oidc_endpoint/oidcendpoint
michelhc 5.1 296
Aurelie Bertrand 5.3 297 = Log level =
michelhc 5.1 298
Aurelie Bertrand 5.3 299 You can customize the log level for the authentication valve.
michelhc 5.1 300
Aurelie Bertrand 5.3 301 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 .
michelhc 5.1 302
Aurelie Bertrand 5.3 303 log4j.logger.org.bsworks = **ERROR** , stdout
michelhc 5.1 304
Aurelie Bertrand 5.3 305 log4j.logger.org.bsworks = **DEBUG** , stdout
michelhc 5.1 306
Aurelie Bertrand 5.3 307 = OpenID Connect authentication on the Enterprise Studio side =
michelhc 5.1 308
Aurelie Bertrand 5.3 309 To authenticate with OpenID Connect on the Enterprise Studio side, please ensure that you have performed the following actions:
michelhc 5.1 310
Aurelie Bertrand 5.3 311 == Server and domain definitions in the .jnlp file ==
michelhc 5.1 312
Aurelie Bertrand 5.3 313 You can, like the Dashboard, define the server and the domain on which DigDash will rely.
michelhc 5.1 314
Aurelie Bertrand 5.3 315 To do this, modify the end of the digdash.jnlp file in the DigDash installation folder **<digdash_installation> / apache-tomcat / webapps / adminconsole**
michelhc 5.1 316
Aurelie Bertrand 5.3 317 {{code}}
318 <jnlp ...>
319 ...
320 <application-desc main-class="commandline.CommandLineMain">
321 <argument>https://localhost:8443</argument> (1)
322 <argument>ddenterpriseapi</argument> (2)
323 <argument><%=lang%></argument> (3)
324 <argument><%=dashboard%></argument> (4)
325 <argument>-AuthMode=External</argument> (5)
326 <argument>-SSLNoPathCheck</argument> (A)
327 ...
328 </application-desc>
329 </jnlp>
michelhc 5.1 330 {{/code}}
331
Aurelie Bertrand 5.3 332 __Extract from the digdash.jnlp file__
michelhc 5.1 333
Aurelie Bertrand 5.3 334 __**Warning**__** **: the arguments noted (1), (2), (3), (4), (5) must not change order.
michelhc 5.1 335
Aurelie Bertrand 5.3 336 Argument (1): the address of the DigDash server; variable depending on your installation
michelhc 5.1 337
Aurelie Bertrand 5.3 338 Argument (2): the name of the DigDash domain; variable depending on your installation
michelhc 5.1 339
Aurelie Bertrand 5.3 340 Argument (5): The authentication method; External, mandatory
michelhc 5.1 341
Aurelie Bertrand 5.3 342 Argument (A): optional argument, sometimes necessary in the case of SSL, HTTPS connections.
michelhc 5.1 343
Aurelie Bertrand 5.3 344 == Connection to DigDash Enterprise Studio ==
michelhc 5.1 345
Aurelie Bertrand 5.3 346 Download and run the .jnlp by going to the DigDash home page in the Enterprise Studio section.
michelhc 5.1 347
Aurelie Bertrand 5.3 348 [[image:1592471261704-499.png||queryString="width=622&height=306" height="306" width="622"]]
michelhc 5.1 349
Aurelie Bertrand 5.3 350 An authentication window should appear with the IdP authentication target.
michelhc 5.1 351
Aurelie Bertrand 5.3 352 In this document, Google is the OP that we have chosen to illustrate our examples.
michelhc 5.1 353
Aurelie Bertrand 5.3 354 [[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"]]
355 \\
michelhc 5.1 356
Aurelie Bertrand 5.3 357 __Capture: test pattern with Google OP authentication form__
michelhc 5.1 358
Aurelie Bertrand 5.3 359 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.
michelhc 5.1 360
Aurelie Bertrand 5.3 361 [[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"]]
362 \\
michelhc 5.1 363
Aurelie Bertrand 5.3 364 __Capture: window of successful authentication__
michelhc 5.1 365
Aurelie Bertrand 5.3 366 The window will close automatically, then Enterprise Studio will start loading to launch.
michelhc 5.1 367
Aurelie Bertrand 5.3 368 = Lexicon =
michelhc 5.1 369
Aurelie Bertrand 5.3 370 We will call in this document:
michelhc 5.1 371
Aurelie Bertrand 5.3 372 * SSO: Single Sign On or Single Authentication; OpenIDConnect is an SSO method
373 * OP: OpenID Provider or the Identity Provider
374 * PR: the Relying Party or the Service Provider (DigDash)
375 * Endpoint: Entry point
michelhc 5.1 376
Aurelie Bertrand 5.3 377 = References =
michelhc 5.1 378
Aurelie Bertrand 5.3 379 https:~/~/www.oasis-open.org
380
381 //DigDash uses the OpenSource tomcat8-oidcauth library from Boyle Software, Inc. to support the OpenID Connect authentication method.//
382
383 https:~/~/www.boylesoftware.com/
384
385 https:~/~/github.com/boylesoftware/tomcat8-oidcauth
386