Wiki source code of Single sign-on NTLM

Last modified by mperroud on 2021/03/29 06:27

Hide last authors
jhurst 1.1 1 {{ddtoc/}}
2
3 ----
4
mperroud 7.1 5 This document describes how to connect the Waffle valve in DigDash Enterprise to active Windows Integrated Security (NTLM...).
jhurst 1.1 6
mperroud 7.1 7 This add-on is located in **<DDE install>/add-ons/singlesignon/Waffle**.
jhurst 1.1 8
mperroud 7.1 9 The current Waffle version is 1.8.1.
jhurst 1.1 10
mperroud 7.1 11 This document describes all folders and files to modifiy to activate this valve.
jhurst 1.1 12
13 = apache-tomcat / lib =
14
mperroud 7.1 15 __**Cleanup previous waffle version**__
jhurst 1.1 16
mperroud 7.1 17 In case of a DigDash upgrade, you may have a previous version of waffle deployed on the tomcat. You must first clean the corresponding jar files from **<DDE install>/apache-tomcat/lib**. Please refer to the waffle deployment guide from the previous version of DigDash to delete the old waffle library files from **<DDE install>/apache-tomcat/lib**, and only these ones.
jhurst 1.1 18
mperroud 7.1 19 __**Tomcat 9 (from version 2020R2 patch 20210105)**__
jhurst 1.1 20
mperroud 7.1 21 Add the waffle libraries from the folder **<DDE install>/add-ons/singlesignon/Waffle/Tomcat9** to the folder **<DDE install>/apache-tomcat/lib**:
michelhc 3.1 22
23 * caffeine-2.8.4.jar
24 * guava-19.0.jar
25 * jna-5.6.0.jar
26 * jna-platform-5.6.0.jar
27 * slf4j-api-1.7.21.jar
28 * slf4j-log4j12-1.7.21.jar
29 * log4j-1.2.15.jar
30 * waffle-jna-2.3.0.jar
31 * waffle-tomcat9-2.3.0.jar
32 * waffle_digdash_extension_tomcat9.jar
33 * log4j.properties
34
mperroud 7.1 35 __**Tomcat 8**__
jhurst 1.1 36
mperroud 7.1 37 Add the waffle libraries from the folder **<DDE install>/add-ons/singlesignon/Waffle/Tomcat8** to the folder **<DDE install>/apache-tomcat/lib**:
jhurst 1.1 38
39 * guava-19.0.jar
40 * jna-4.2.1.jar
41 * jna-platform-4.2.1.jar
42 * slf4j-api-1.7.21.jar
43 * slf4j-log4j12-1.7.21.jar
44 * log4j-1.2.15.jar
45 * waffle-jna-1.8.1.jar
46 * waffle-tomcat8-1.8.1.jar
47 * waffle_digdash_extension_tomcat8.jar
48 * log4j.properties
49
mperroud 7.1 50 __**Tomcat 7**__
jhurst 1.1 51
mperroud 7.1 52 Add the waffle libraries from the folder **<DDE install>/add-ons/singlesignon/Waffle/Tomcat7** to the folder **<DDE install>/apache-tomcat/lib**:
jhurst 1.1 53
54 * guava-19.0.jar
55 * jna-4.2.1.jar
56 * jna-platform-4.2.1.jar
57 * slf4j-api-1.7.21.jar
58 * slf4j-log4j12-1.7.21.jar
59 * log4j-1.2.15.jar
60 * waffle-jna-1.8.1.jar
61 * waffle-tomcat7-1.8.1.jar
62 * waffle_digdash_extension_tomcat7.jar
63 * log4j.properties
64
65 = apache-tomcat / conf / context.xml =
66
mperroud 7.1 67 Add the following security valve XML:
fperrier 2.1 68
mperroud 7.1 69 <Valve className="waffle.apache.SharedNegotiateAuthenticator" principalFormat="fqn" roleFormat="both" **sharedPasswd**="**SecretPwdToChange**" **allowAddr**="**localhost,127.0.0.***"/>
jhurst 1.1 70
mperroud 7.1 71 <Realm className="waffle.apache.WindowsRealm"/>
fperrier 2.1 72
mperroud 7.1 73 It is important to change the shared password (**sharedPasswd**). This password must be identical to the one specified in file **<DDE install>/apache-tomcat/digdash_dashboard/WEB-INF/web.xml** (see chapter IV).
jhurst 1.1 74
mperroud 7.1 75 You can also add allowed remote host addresses (**allowAddr**) to let other applications (digdash_dashboard) to connect to DigDash Enterprise server. In **allowAddr** attribute, you should add your server's IP address.
76
jhurst 1.1 77 = apache-tomcat / conf / web.xml =
78
mperroud 7.1 79 Add the XML content for the security constraint:
jhurst 1.1 80
81 {{code language="XML"}}
82 <security-role>
mperroud 7.1 83 <role-name>Everyone</role-name>
jhurst 1.1 84 </security-role>
mperroud 7.1 85
jhurst 1.1 86 <security-constraint>
mperroud 7.1 87 <display-name>Waffle Security Constraint</display-name>
88 <web-resource-collection>
89 <web-resource-name>Protected Area</web-resource-name>
90 <url-pattern>/*</url-pattern>
91 </web-resource-collection>
92 <auth-constraint>
93 <role-name>Everyone</role-name>
94 </auth-constraint>
jhurst 1.1 95 </security-constraint>
mperroud 7.1 96
jhurst 1.1 97 <security-constraint>
mperroud 7.1 98 <display-name>vjdbc Security Constraint</display-name>
99 <web-resource-collection>
100 <web-resource-name>UnProtected Area</web-resource-name>
101 <url-pattern>/vjdbc/*</url-pattern>
102 </web-resource-collection>
jhurst 1.1 103 </security-constraint>
104 {{/code}}
105
mperroud 7.1 106 //Important//
jhurst 1.1 107
108 (% class="box warningmessage" %)
109 (((
mperroud 7.1 110 Security role name (role-name) MUST match the actual role you have in your AD (localized). Example : BUILTIN\Users
jhurst 1.1 111 )))
112
mperroud 7.1 113 If your are not sure about the role names in your Active Directory, you can activate the debug log for waffle by using the provided log4j.properties. You just need to copy this file into **<DDE install>/apache-tomcat/lib**
jhurst 1.1 114
115 = apache-tomcat / webapps / digdash_dashboard / WEB-INF / web.xml =
116
mperroud 7.1 117 Search for the definition of the parameter **sharedPasswd** in this file, un-comment the corresponding XML and change the password value (__**bold underline**__):
jhurst 1.1 118
119 {{code language="XML"}}
120 <init-param>
mperroud 7.1 121 <param-name>sharedPasswd</param-name>
122 <param-value>SecretPwdToChange</param-value>
jhurst 1.1 123 </init-param>
124 {{/code}}
125
mperroud 7.1 126 //Important//
jhurst 1.1 127
128 (% class="box warningmessage" %)
129 (((
mperroud 7.1 130 The specified password must be identical to the one set in file **<DDE install>/apache-tomcat/conf/context.xml** (chapter II).
jhurst 1.1 131 )))
132
mperroud 7.1 133 (% class="wikigeneratedid" id="HRecommendedparametersforautomaticloginindashboard" %)
134 __Recommended parameters for automatic login in dashboard__
jhurst 1.1 135
mperroud 7.1 136 It is recommended to configure the following parameters in file **<DDE install>/apache-tomcat/webapps/digdash_dashboard/WEB-INF/web.xml** when deploying for using Windows Integrated Security (Waffle).
jhurst 1.1 137
mperroud 7.1 138 Specify (and force) DigDash Enterprise domain:
jhurst 1.1 139
mperroud 7.1 140 {{code}}
jhurst 1.1 141 <init-param>
mperroud 7.1 142 <param-name>DOMAIN</param-name>
143 <param-value>ddenterpriseapi</param-value>
jhurst 1.1 144 </init-param>
145 <init-param>
mperroud 7.1 146 <param-name>FORCEDOMAIN</param-name>
147 <param-value>true</param-value>
jhurst 1.1 148 </init-param>
mperroud 7.1 149
jhurst 1.1 150 {{/code}}
151
mperroud 7.1 152 Specify (and force) DigDash Enterprise domain URL. Use localhost address when ddenterpriseapi web application is installed on the same Tomcat than digdash_dashboard web application. Adapt port if needed:
jhurst 1.1 153
154 {{code language="XML"}}
155 <init-param>
mperroud 7.1 156 <param-name>SERVERURL</param-name>
157 <param-value>http://localhost:8080</param-value>
jhurst 1.1 158 </init-param>
159 <init-param>
mperroud 7.1 160 <param-name>FORCESERVERURL</param-name>
161 <param-value>true</param-value>
jhurst 1.1 162 </init-param>
163 {{/code}}
164
mperroud 7.1 165 Specify a logout URL to allow the user to disconnect properly from DigDash Enterprise and, for example, return to an Intranet page:
jhurst 1.1 166
167 {{code language="XML"}}
168 <init-param>
mperroud 7.1 169 <param-name>urlLogout</param-name>
170 <param-value>/adminconsole</param-value>
jhurst 1.1 171 </init-param>
172 {{/code}}
173
mperroud 7.1 174 //Important//
jhurst 1.1 175
176 (% class="box warningmessage" %)
177 (((
mperroud 7.1 178 By default, loging out the dashboard returns to its login page. This page is bypassed in a SSO context, so it automatically logs in the user again. It is important to specify a logout page to create a nice user experience.
jhurst 1.1 179 )))
180
mperroud 7.1 181 See the document **digdash_enterprise_advanced_system_guide_en.pdf** for more details on these parameters.
jhurst 1.1 182
183 = apache-tomcat / webapps / studio / WEB-INF / web.xml =
184
mperroud 7.1 185 Search for the definition of the parameter **sharedPasswd** in this file, un-comment the corresponding XML and change the password value (__**bold underline**__):
jhurst 1.1 186
187 {{code language="XML"}}
mperroud 7.1 188 <init-param>
189 <param-name>sharedPasswd</param-name>
190 <param-value>SecretPwdToChange</param-value>
191 </init-param>
jhurst 1.1 192 {{/code}}
193
194
195 (% class="box warningmessage" %)
196 (((
mperroud 7.1 197 The specified password must be identical to the one set in file **<DDE install>/apache-tomcat/conf/context.xml** (chapter II).
jhurst 1.1 198 )))
199
200
mperroud 7.1 201 (% id="cke_bm_209S" style="display:none" %) (%%)Search for the definition of the parameter **authMethod** in this file, un-comment the corresponding XML:
202
mperroud 4.1 203 {{code language="XML"}}
mperroud 7.1 204 <init-param>
205 <param-name>authMethod</param-name>
206 <param-value>NTUserOrLDAP</param-value>
207 </init-param>
mperroud 4.1 208 {{/code}}
209
210
mperroud 7.1 211 (% class="wikigeneratedid" id="HRecommendedparametersforautomaticloginindashboard" %)
212 __Recommended parameters for automatic login in studio__
jhurst 1.1 213
mperroud 7.1 214 It is recommended to configure the following parameters in file **<DDE install>/apache-tomcat/webapps/studio/WEB-INF/web.xml** when deploying for using Windows Integrated Security (Waffle).
jhurst 1.1 215
mperroud 7.1 216 Specify (and force) DigDash Enterprise domain:
jhurst 1.1 217
mperroud 7.1 218 {{code}}
219 <init-param>
220 <param-name>DOMAIN</param-name>
221 <param-value>ddenterpriseapi</param-value>
222 </init-param>
223 <init-param>
224 <param-name>FORCEDOMAIN</param-name>
225 <param-value>true</param-value>
226 </init-param>
227
jhurst 1.1 228 {{/code}}
229
mperroud 7.1 230 Specify (and force) DigDash Enterprise domain URL. Use localhost address when ddenterpriseapi web application is installed on the same Tomcat than studio web application. Adapt port if needed:
jhurst 1.1 231
mperroud 7.1 232 {{code language="XML"}}
233 <init-param>
234 <param-name>SERVERURL</param-name>
235 <param-value>http://localhost:8080</param-value>
236 </init-param>
237 <init-param>
238 <param-name>FORCESERVERURL</param-name>
239 <param-value>true</param-value>
240 </init-param>
jhurst 1.1 241 {{/code}}
242
mperroud 7.1 243 Specify a logout URL to allow the user to disconnect properly from DigDash Enterprise and, for example, return to an Intranet page:
jhurst 1.1 244
mperroud 7.1 245 {{code language="XML"}}
246 <init-param>
247 <param-name>urlLogout</param-name>
248 <param-value>/adminconsole</param-value>
249 </init-param>
jhurst 1.1 250 {{/code}}
251
mperroud 7.1 252 //Important//
jhurst 1.1 253
mperroud 7.1 254 (% class="box warningmessage" %)
255 (((
256 By default, loging out the studio returns to its login page. This page is bypassed in a SSO context, so it automatically logs in the user again. It is important to specify a logout page to create a nice user experience.
257 )))
258
259 See the document **digdash_enterprise_advanced_system_guide_en.pdf** for more details on these parameters.
260
jhurst 1.1 261 = apache-tomcat / webapps / ddenterpriseapi / WEB-INF / web.xml =
262
mperroud 7.1 263 Search for definition of the **authMethod** parameter in this file and change its value into **NTUser**:
jhurst 1.1 264
mperroud 7.1 265 {{code}}
jhurst 1.1 266 <init-param>
mperroud 7.1 267 <param-name>authMethod</param-name>
268 <!-- possible values: LDAP, PassThru, NTUser, NTUserOrLDAP -->
269 <param-value>NTUser</param-value>
jhurst 1.1 270 </init-param>
271 {{/code}}
272
mperroud 7.1 273 //Note//
jhurst 1.1 274
mperroud 7.1 275 (% class="box infomessage" %)
276 (((
277 The mode «** NTUserOrLDAP **» let the user authenticate on the DigDash server through Windows Integrated Security, with a fallback authentication through DigDash LDAP.
278 )))
jhurst 1.1 279
mperroud 7.1 280 For instance, a user from the NT domain could automatically pass the Waffle valve with his Windows credentials, but would fail loging in DigDash if he does not exist in DigDash LDAP. In that mode, he would get a login form to specify a DigDash login/password.
jhurst 1.1 281
mperroud 7.1 282 Also in this mode is an optional parameter «** loginForm **» used in some URLs which allows the login page to be always displayed. This way the Windows credentials are only used to pass the Waffle valve. A typical use case is to allow a Windows user to connect as “admin” in DigDash settings pages.
jhurst 1.1 283
284 = apache-tomcat / webapps / adminconsole / digdash.jnlp =
285
michelhc 3.1 286 {{warning}}
mperroud 7.1 287 We would rather use the Web Studio from version 2020R2.
michelhc 3.1 288 {{/warning}}
289
mperroud 7.1 290 By default, when the DigDash server is configured to use the Windows Integrated Security, the user must enter its Windows login (NT domain\user) and password in the Studio login dialog box. For instance:
jhurst 1.1 291
mperroud 7.1 292 User: NT_DOMAIN\user1
jhurst 1.1 293
mperroud 7.1 294 Password: ~*~*~*~*~*~*
jhurst 1.1 295
mperroud 7.1 296 There is a way to allow the Studio to automatically authenticate the current logged Windows user. The following conditions are required:
jhurst 1.1 297
mperroud 7.1 298 * Studio is launched on a Windows computer, from a Windows session authenticated in the concerned Windows security domain
299 * The URL of the DigDash server, the DigDash enterprise domain name, and the authentication mode of the Studio (NTUser, NTUserOrLDAP…) are specified and forced in the JNLP file
jhurst 1.1 300
mperroud 7.1 301 Proceed with the following configuration in the **<DDE install>/apache-tomcat/webapps/adminconsole/digdash.jnlp** file if you want to activate the automatic login with Windows Integrated Security in DigDash Enterprise Studio.
jhurst 1.1 302
mperroud 7.1 303 At the end of this file you will find the XML for the parameter of the Studio. Replace the value of some of the parameters as shown below (see values in __**bold underline**__):
jhurst 1.1 304
mperroud 7.1 305 {{code language="XML"}}
jhurst 1.1 306 <application-desc main-class="commandline.CommandLineMain">
mperroud 7.1 307 <argument>http://server_digdash:8080</argument>
jhurst 1.1 308 <argument>ddenterpriseapi</argument>
mperroud 7.1 309 <argument><%=lang%></argument>
310 <argument><%=dashboard%></argument>
311 <argument>true</argument>
312 <argument>NTUser</argument>
jhurst 1.1 313 </application-desc>
314 {{/code}}
315
mperroud 7.1 316 Description of the modified parameters:
jhurst 1.1 317
mperroud 7.1 318 * 1^^st^^ parameter: DigDash serveur URL accessed by the Studio.
319 * 2^^nd^^ parameter: DigDash Enterprise domain name.
320 * 5^^th^^ parameter: Force specified URL and domaine name: they are read-only in Studio’s login dialog box (true).
321 * 6^^th^^ parameter: Forced authentication mode for the Studio (see chapter V for more details). Only the «** NTUser **», «** NTUserOrLDAP **» or « **NTUserOrLDAP,loginForm** » allow the automatic login with Windows Integrated Security.