Wiki source code of Single sign-on NTLM

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

Show last authors
1 {{ddtoc/}}
2
3 ----
4
5 This document describes how to connect the Waffle valve in DigDash Enterprise to active Windows Integrated Security (NTLM...).
6
7 This add-on is located in **<DDE install>/add-ons/singlesignon/Waffle**.
8
9 The current Waffle version is 1.8.1.
10
11 This document describes all folders and files to modifiy to activate this valve.
12
13 = apache-tomcat / lib =
14
15 __**Cleanup previous waffle version**__
16
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.
18
19 __**Tomcat 8**__
20
21 Add the waffle libraries from the folder **<DDE install>/add-ons/singlesignon/Waffle/Tomcat8** to the folder **<DDE install>/apache-tomcat/lib**:
22
23 * guava-19.0.jar
24 * jna-4.2.1.jar
25 * jna-platform-4.2.1.jar
26 * slf4j-api-1.7.21.jar
27 * slf4j-log4j12-1.7.21.jar
28 * log4j-1.2.15.jar
29 * waffle-jna-1.8.1.jar
30 * waffle-tomcat8-1.8.1.jar
31 * waffle_digdash_extension_tomcat8.jar
32 * log4j.properties
33
34 __**Tomcat 7**__
35
36 Add the waffle libraries from the folder **<DDE install>/add-ons/singlesignon/Waffle/Tomcat7** to the folder **<DDE install>/apache-tomcat/lib**:
37
38 * guava-19.0.jar
39 * jna-4.2.1.jar
40 * jna-platform-4.2.1.jar
41 * slf4j-api-1.7.21.jar
42 * slf4j-log4j12-1.7.21.jar
43 * log4j-1.2.15.jar
44 * waffle-jna-1.8.1.jar
45 * waffle-tomcat7-1.8.1.jar
46 * waffle_digdash_extension_tomcat7.jar
47 * log4j.properties
48
49 = apache-tomcat / conf / context.xml =
50
51 Add the following security valve XML:
52
53 <Valve className="waffle.apache.SharedNegotiateAuthenticator" principalFormat="fqn" roleFormat="both" **sharedPasswd**="**SecretPwdToChange**" **allowAddr**="**localhost,127.0.0.***"/>
54
55 <Realm className="waffle.apache.WindowsRealm"/>
56
57 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).
58
59 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.
60
61 = apache-tomcat / conf / web.xml =
62
63 Add the XML content for the security constraint:
64
65 {{code language="XML"}}
66 <security-role>
67 <role-name>Everyone</role-name>
68 </security-role>
69
70 <security-constraint>
71 <display-name>Waffle Security Constraint</display-name>
72 <web-resource-collection>
73 <web-resource-name>Protected Area</web-resource-name>
74 <url-pattern>/*</url-pattern>
75 </web-resource-collection>
76 <auth-constraint>
77 <role-name>Everyone</role-name>
78 </auth-constraint>
79 </security-constraint>
80
81 <security-constraint>
82 <display-name>vjdbc Security Constraint</display-name>
83 <web-resource-collection>
84 <web-resource-name>UnProtected Area</web-resource-name>
85 <url-pattern>/vjdbc/*</url-pattern>
86 </web-resource-collection>
87 </security-constraint>
88 {{/code}}
89
90 //Important//
91
92 (% class="box warningmessage" %)
93 (((
94 Security role name (role-name) MUST match the actual role you have in your AD (localized). Example : BUILTIN\Users
95 )))
96
97 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**
98
99 = apache-tomcat / webapps / digdash_dashboard / WEB-INF / web.xml =
100
101 Search for the definition of the parameter **sharedPasswd** in this file, un-comment the corresponding XML and change the password value (__**bold underline**__):
102
103 {{code language="XML"}}
104 <init-param>
105 <param-name>sharedPasswd</param-name>
106 <param-value>SecretPwdToChange</param-value>
107 </init-param>
108 {{/code}}
109
110 //Important//
111
112 (% class="box warningmessage" %)
113 (((
114 The specified password must be identical to the one set in file **<DDE install>/apache-tomcat/conf/context.xml** (chapter II).
115 )))
116
117 (% class="wikigeneratedid" id="HRecommendedparametersforautomaticloginindashboard" %)
118 __Recommended parameters for automatic login in dashboard__
119
120 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).
121
122 Specify (and force) DigDash Enterprise domain:
123
124 {{code}}
125 <init-param>
126 <param-name>DOMAIN</param-name>
127 <param-value>ddenterpriseapi</param-value>
128 </init-param>
129 <init-param>
130 <param-name>FORCEDOMAIN</param-name>
131 <param-value>true</param-value>
132 </init-param>
133
134 {{/code}}
135
136 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:
137
138 {{code language="XML"}}
139 <init-param>
140 <param-name>SERVERURL</param-name>
141 <param-value>http://localhost:8080</param-value>
142 </init-param>
143 <init-param>
144 <param-name>FORCESERVERURL</param-name>
145 <param-value>true</param-value>
146 </init-param>
147 {{/code}}
148
149 Specify a logout URL to allow the user to disconnect properly from DigDash Enterprise and, for example, return to an Intranet page:
150
151 {{code language="XML"}}
152 <init-param>
153 <param-name>urlLogout</param-name>
154 <param-value>/adminconsole</param-value>
155 </init-param>
156 {{/code}}
157
158 //Important//
159
160 (% class="box warningmessage" %)
161 (((
162 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.
163 )))
164
165 See the document **digdash_enterprise_advanced_system_guide_en.pdf** for more details on these parameters.
166
167 = apache-tomcat / webapps / ddenterpriseapi / WEB-INF / web.xml =
168
169 Search for definition of the **authMethod** parameter in this file and change its value into **NTUser**:
170
171 {{code}}
172 <init-param>
173 <param-name>authMethod</param-name>
174 <!-- possible values: LDAP, PassThru, NTUser, NTUserOrLDAP -->
175 <param-value>NTUser</param-value>
176 </init-param>
177 {{/code}}
178
179 //Note//
180
181 (% class="box infomessage" %)
182 (((
183 The mode «** NTUserOrLDAP **» let the user authenticate on the DigDash server through Windows Integrated Security, with a fallback authentication through DigDash LDAP.
184 )))
185
186 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.
187
188 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.
189
190 = apache-tomcat / webapps / adminconsole / digdash.jnlp =
191
192 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:
193
194 User: NT_DOMAIN\user1
195
196 Password: ~*~*~*~*~*~*
197
198 There is a way to allow the Studio to automatically authenticate the current logged Windows user. The following conditions are required:
199
200 * Studio is launched on a Windows computer, from a Windows session authenticated in the concerned Windows security domain
201 * 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
202
203 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.
204
205 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**__):
206
207 {{code language="XML"}}
208 <application-desc main-class="commandline.CommandLineMain">
209 <argument>http://server_digdash:8080</argument>
210 <argument>ddenterpriseapi</argument>
211 <argument><%=lang%></argument>
212 <argument><%=dashboard%></argument>
213 <argument>true</argument>
214 <argument>NTUser</argument>
215 </application-desc>
216 {{/code}}
217
218 Description of the modified parameters:
219
220 * 1^^st^^ parameter: DigDash serveur URL accessed by the Studio.
221 * 2^^nd^^ parameter: DigDash Enterprise domain name.
222 * 5^^th^^ parameter: Force specified URL and domaine name: they are read-only in Studio’s login dialog box (true).
223 * 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.