Wiki source code of Single sign-on NTLM

Last modified by Aurelie Bertrand on 2025/02/07 10:19

Hide last authors
jhurst 1.1 1 {{ddtoc/}}
2
3 ----
4
Aurelie Bertrand 33.1 5 This document describes how to connect the Waffle valve in DigDash Enterprise to active Windows Integrated Security (NTLM...).
jhurst 1.1 6
Aurelie Bertrand 33.1 7 This add-on is located in **<DDE install>/add-ons/singlesignon/Waffle**.
jhurst 1.1 8
Aurelie Bertrand 33.1 9 The current Waffle version is 1.8.1.
jhurst 1.1 10
Aurelie Bertrand 33.1 11 This document describes all folders and files to modifiy to activate this valve.
jhurst 1.1 12
Aurelie Bertrand 33.1 13 = apache-tomcat / lib =
mperroud 5.1 14
Aurelie Bertrand 33.1 15 __**Cleanup previous waffle version**__
Aurelie Bertrand 26.1 16
Aurelie Bertrand 33.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.
Aurelie Bertrand 26.1 18
Aurelie Bertrand 33.1 19 __**Tomcat 9 (from version 2020R2 patch 20210105)**__
jhurst 1.1 20
Aurelie Bertrand 33.1 21 Add the waffle libraries from the folder **<DDE install>/add-ons/singlesignon/Waffle/Tomcat9** to the folder **<DDE install>/apache-tomcat/lib**:
jhurst 1.1 22
Aurelie Bertrand 33.1 23 * caffeine-2.8.4.jar
michelhc 3.1 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
Aurelie Bertrand 33.1 35 __**Tomcat 8**__
jhurst 1.1 36
Aurelie Bertrand 33.1 37 Add the waffle libraries from the folder **<DDE install>/add-ons/singlesignon/Waffle/Tomcat8** to the folder **<DDE install>/apache-tomcat/lib**:
Aurelie Bertrand 26.1 38
Aurelie Bertrand 33.1 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
Aurelie Bertrand 26.1 49
Aurelie Bertrand 33.1 50 __**Tomcat 7**__
fperrier 2.1 51
Aurelie Bertrand 33.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
Aurelie Bertrand 33.1 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
fperrier 2.1 64
Aurelie Bertrand 33.1 65 = apache-tomcat / conf / context.xml =
mperroud 7.2 66
Aurelie Bertrand 33.1 67 Add the following security valve XML:
jhurst 1.1 68
Aurelie Bertrand 33.1 69 <Valve className="waffle.apache.SharedNegotiateAuthenticator" principalFormat="fqn" roleFormat="both" **sharedPasswd**="**SecretPwdToChange**" **allowAddr**="**localhost,127.0.0.***"/>
Aurelie Bertrand 32.1 70
Aurelie Bertrand 33.1 71 <Realm className="waffle.apache.WindowsRealm"/>
jhurst 1.1 72
Aurelie Bertrand 33.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).
Aurelie Bertrand 26.1 74
Aurelie Bertrand 33.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.
Aurelie Bertrand 26.1 76
Aurelie Bertrand 33.1 77 = apache-tomcat / conf / web.xml =
jhurst 1.1 78
Aurelie Bertrand 33.1 79 Add the XML content for the security constraint:
80
81 {{code language="XML" cssClass="notranslate"}}
jhurst 1.1 82 <security-role>
Aurelie Bertrand 33.1 83 <role-name>Everyone</role-name>
jhurst 1.1 84 </security-role>
Aurelie Bertrand 33.1 85
jhurst 1.1 86 <security-constraint>
Aurelie Bertrand 33.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>
Aurelie Bertrand 33.1 96
jhurst 1.1 97 <security-constraint>
Aurelie Bertrand 33.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
Aurelie Bertrand 33.1 106 //Important//
Aurelie Bertrand 20.1 107
jhurst 1.1 108 (% class="box warningmessage" %)
109 (((
Aurelie Bertrand 33.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
Aurelie Bertrand 33.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
Aurelie Bertrand 33.1 115 = apache-tomcat / webapps / digdash_dashboard / WEB-INF / web.xml =
jhurst 1.1 116
Aurelie Bertrand 33.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**__):
Aurelie Bertrand 29.1 118
Aurelie Bertrand 33.1 119 {{code language="XML" cssClass="notranslate"}}
120 <init-param>
121 <param-name>sharedPasswd</param-name>
122 <param-value>SecretPwdToChange</param-value>
123 </init-param>
124 {{/code}}
mperroud 4.2 125
Aurelie Bertrand 33.1 126 //Important//
mperroud 4.2 127
Aurelie Bertrand 33.1 128 (% class="box warningmessage" %)
129 (((
130 The specified password must be identical to the one set in file **<DDE install>/apache-tomcat/conf/context.xml** (chapter II).
131 )))
mperroud 4.2 132
Aurelie Bertrand 33.1 133 (% class="wikigeneratedid" id="HRecommendedparametersforautomaticloginindashboard" %)
134 __Recommended parameters for automatic login in dashboard__
mperroud 4.2 135
Aurelie Bertrand 33.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).
mperroud 4.2 137
Aurelie Bertrand 33.1 138 Specify (and force) DigDash Enterprise domain:
mperroud 6.6 139
Aurelie Bertrand 33.1 140 {{code cssClass="notranslate"}}
141 <init-param>
142 <param-name>DOMAIN</param-name>
143 <param-value>ddenterpriseapi</param-value>
144 </init-param>
145 <init-param>
146 <param-name>FORCEDOMAIN</param-name>
147 <param-value>true</param-value>
148 </init-param>
149
mperroud 6.6 150 {{/code}}
151
Aurelie Bertrand 33.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:
mperroud 6.6 153
Aurelie Bertrand 33.1 154 {{code language="XML" cssClass="notranslate"}}
155 <init-param>
156 <param-name>SERVERURL</param-name>
157 <param-value>http://localhost:8080</param-value>
158 </init-param>
159 <init-param>
160 <param-name>FORCESERVERURL</param-name>
161 <param-value>true</param-value>
162 </init-param>
163 {{/code}}
mperroud 6.6 164
Aurelie Bertrand 33.1 165 Specify a logout URL to allow the user to disconnect properly from DigDash Enterprise and, for example, return to an Intranet page:
mperroud 6.6 166
Aurelie Bertrand 33.1 167 {{code language="XML" cssClass="notranslate"}}
168 <init-param>
169 <param-name>urlLogout</param-name>
170 <param-value>/adminconsole</param-value>
171 </init-param>
172 {{/code}}
mperroud 6.6 173
Aurelie Bertrand 33.1 174 //Important//
mperroud 4.2 175
Aurelie Bertrand 33.1 176 (% class="box warningmessage" %)
177 (((
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.
179 )))
mperroud 4.2 180
Aurelie Bertrand 33.1 181 See the document **digdash_enterprise_advanced_system_guide_en.pdf** for more details on these parameters.
mperroud 6.2 182
Aurelie Bertrand 33.1 183 = apache-tomcat / webapps / studio / WEB-INF / web.xml =
184
185 Search for the definition of the parameter **sharedPasswd** in this file, un-comment the corresponding XML and change the password value (__**bold underline**__):
186
187 {{code language="XML" cssClass="notranslate"}}
188 <init-param>
189 <param-name>sharedPasswd</param-name>
190 <param-value>SecretPwdToChange</param-value>
191 </init-param>
jhurst 1.1 192 {{/code}}
193
Aurelie Bertrand 33.1 194 //Important//
195
jhurst 1.1 196 (% class="box warningmessage" %)
197 (((
Aurelie Bertrand 33.1 198 The specified password must be identical to the one set in file **<DDE install>/apache-tomcat/conf/context.xml** (chapter II).
jhurst 1.1 199 )))
200
Aurelie Bertrand 33.1 201 (% class="wikigeneratedid" id="HRecommendedparametersforautomaticloginindashboard" %)
202 __Recommended parameters for automatic login in studio__
jhurst 1.1 203
Aurelie Bertrand 33.1 204 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 205
Aurelie Bertrand 33.1 206 Specify (and force) DigDash Enterprise domain:
jhurst 1.1 207
Aurelie Bertrand 33.1 208 {{code cssClass="notranslate"}}
209 <init-param>
210 <param-name>DOMAIN</param-name>
211 <param-value>ddenterpriseapi</param-value>
212 </init-param>
213 <init-param>
214 <param-name>FORCEDOMAIN</param-name>
215 <param-value>true</param-value>
216 </init-param>
jhurst 1.1 217
218 {{/code}}
219
Aurelie Bertrand 33.1 220 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 221
Aurelie Bertrand 33.1 222 {{code language="XML" cssClass="notranslate"}}
223 <init-param>
224 <param-name>SERVERURL</param-name>
225 <param-value>http://localhost:8080</param-value>
226 </init-param>
227 <init-param>
228 <param-name>FORCESERVERURL</param-name>
229 <param-value>true</param-value>
230 </init-param>
jhurst 1.1 231 {{/code}}
232
Aurelie Bertrand 33.1 233 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 234
Aurelie Bertrand 33.1 235 {{code language="XML" cssClass="notranslate"}}
236 <init-param>
237 <param-name>urlLogout</param-name>
238 <param-value>/adminconsole</param-value>
239 </init-param>
jhurst 1.1 240 {{/code}}
241
Aurelie Bertrand 33.1 242 //Important//
jhurst 1.1 243
244 (% class="box warningmessage" %)
245 (((
Aurelie Bertrand 33.1 246 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.
jhurst 1.1 247 )))
248
Aurelie Bertrand 33.1 249 See the document **digdash_enterprise_advanced_system_guide_en.pdf** for more details on these parameters.
jhurst 1.1 250
Aurelie Bertrand 33.1 251 = apache-tomcat / webapps / ddenterpriseapi / WEB-INF / web.xml =
mperroud 6.3 252
Aurelie Bertrand 33.1 253 Search for definition of the **authMethod** parameter in this file and change its value into **NTUser**:
mperroud 6.3 254
Aurelie Bertrand 33.1 255 {{code cssClass="notranslate"}}
256 <init-param>
257 <param-name>authMethod</param-name>
258 <!-- possible values: LDAP, PassThru, NTUser, NTUserOrLDAP -->
259 <param-value>NTUser</param-value>
260 </init-param>
mperroud 7.3 261 {{/code}}
262
Aurelie Bertrand 33.1 263 //Note//
mperroud 6.3 264
Aurelie Bertrand 33.1 265 (% class="box infomessage" %)
jhurst 1.1 266 (((
Aurelie Bertrand 33.1 267 The mode «** NTUserOrLDAP **» let the user authenticate on the DigDash server through Windows Integrated Security, with a fallback authentication through DigDash LDAP.
jhurst 1.1 268 )))
269
Aurelie Bertrand 33.1 270 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 271
Aurelie Bertrand 33.1 272 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 273
Aurelie Bertrand 33.1 274 = apache-tomcat / webapps / adminconsole / digdash.jnlp =
jhurst 1.1 275
Aurelie Bertrand 33.1 276 {{warning}}
277 We would rather use the Web Studio from version 2020R2.
278 {{/warning}}
jhurst 1.1 279
Aurelie Bertrand 33.1 280 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 281
Aurelie Bertrand 33.1 282 User: NT_DOMAIN\user1
jhurst 1.1 283
Aurelie Bertrand 33.1 284 Password: ~*~*~*~*~*~*
jhurst 1.1 285
Aurelie Bertrand 33.1 286 There is a way to allow the Studio to automatically authenticate the current logged Windows user. The following conditions are required:
jhurst 1.1 287
Aurelie Bertrand 33.1 288 * Studio is launched on a Windows computer, from a Windows session authenticated in the concerned Windows security domain
289 * 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
290
291 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.
292
293 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**__):
294
295 {{code language="XML" cssClass="notranslate"}}
296 <application-desc main-class="commandline.CommandLineMain">
297 <argument>http://server_digdash:8080</argument>
298 <argument>ddenterpriseapi</argument>
299 <argument><%=lang%></argument>
300 <argument><%=dashboard%></argument>
301 <argument>true</argument>
302 <argument>NTUser</argument>
303 </application-desc>
jhurst 1.1 304 {{/code}}
305
Aurelie Bertrand 33.1 306 Description of the modified parameters:
307
308 * 1^^st^^ parameter: DigDash serveur URL accessed by the Studio.
309 * 2^^nd^^ parameter: DigDash Enterprise domain name.
310 * 5^^th^^ parameter: Force specified URL and domaine name: they are read-only in Studio’s login dialog box (true).
311 * 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.