Wiki source code of Einmalanmeldung


Show last authors
1 //Single sign-on// for {{smallcaps}}Ntlm{{/smallcaps}} and Kerberos is a {{formcycle/}} license module which is subject to additional costs.
2
3 {{content/}}
4
5 {{warning}}
6 We would like to inform you that in future we will say goodbye to {{smallcaps}}Ntlm{{/smallcaps}} as an option for single sign-on. We are following a general recommendation from Microsoft, according to which {{smallcaps}}Ntlm{{/smallcaps}} should no longer be used by applications in the future due to insufficient security mechanisms ([[statement from Microsoft>>https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-nlmp/1e846608-4c5f-41f4-8454-1b91af8a755b?redirectedfrom=MSDN||rel="noopener noreferrer" target="_blank"]] or [[statement in the forum>>https://answers.microsoft.com/en-us/msoffice/forum/all/ntlm-vs-kerberos/d8b139bf-6b5a-4a53-9a00-bb75d4e219eb||rel="noopener noreferrer" target="_blank"]] under Chapter 3). Microsoft then published patches to improve security, but these will no longer work with the current {{smallcaps}}Ntlm{{/smallcaps}} implementation in FORMCYCLE. Since it is not recommended to continue using the module, we will stop further development of the module from FORMCYCLE version 7 onwards.
7
8 For existing customers we offer to switch to Kerberos for free. The activation for Kerberos is done automatically in the licence of V7, if {{smallcaps}}Ntlm{{/smallcaps}} has already been licensed.
9 {{/warning}}
10
11 {{figure image="single_sign_on_ntlm_en.png" width="600"}}
12 User interface for setting up {{smallcaps}}Ldap{{/smallcaps}} authentication via {{smallcaps}}Ntlm{{/smallcaps}}. Available only if the license allows it.
13 {{/figure}}
14
15 {{smallcaps}}Ntlm{{/smallcaps}} (NT LAN Manager) can be used to authenticate users of a form.
16
17 A common use case are forms used internally by some company, and that may be accessed only by the employees of that company. The user data of the active directory can be accessed via {{smallcaps}}Ntlm{{/smallcaps}}.
18
19 {{info}}
20 {{smallcaps}}Ntlm{{/smallcaps}} may not be available depending on your license.
21 {{/info}}
22
23 == Using NTLM ==
24
25 Activate this option to use {{smallcaps}}Ntlm{{/smallcaps}}.
26
27 === Synchronize with {{fserver/}} ===
28
29 Activate this option to transmit the current configuration to all connected and available {{fserver number="plural"/}} when saving these settings.
30
31 === Domain controller host ===
32
33 The host (FQN) of the active directory controller used for authenticating users via {{smallcaps}}Ntlm{{/smallcaps}} and transmitting their data over {{smallcaps}}Ldap{{/smallcaps}}.
34
35 {{code language="none"}}
36 Example: domain.example.com
37 {{/code}}
38
39 Connection to the {{smallcaps}}Ldap{{/smallcaps}} server for the {{smallcaps}}Ldap{{/smallcaps}} search account has been established successfully
40
41 == NTLM authentication ==
42
43 The following settings are required for enabling users to authenticate via {{smallcaps}}Ntlm{{/smallcaps}}.
44
45 === Host name of the domain controller host ===
46
47 The host name of the active directory controller.
48
49 {{code language="none"}}
50 Example: domain
51 {{/code}}
52
53 === Windows domain name ===
54
55 Different forms of the domain name can be used depending on the active directory.
56
57 {{code language="none"}}
58 Example: example.de oder example0
59 {{/code}}
60
61 {{info}}
62 Here you must specify the domain name to which the user accounts to be authenticated belong.
63 This domain name may be different from the domain of the computer account (This is the computer's NetBIOS name, not the DNS / FQDN name).
64
65 The Windows domain name to be used can be determined, for example, by opening a Windows console (//Start / Run / cmd//) on a client logged into the domain and entering the following command:
66 **echo %userdomain%**
67 {{/info}}
68
69 === Computer account ===
70
71 The computer account must have been granted permission to perform user verification. It **must not be** a regular user account.
72
73 {{info}}
74 A computer account is recognizable by the '$' character in the domain name. e.g. example$@domain.de
75 {{/info}}
76
77 We are currently unable to provide a description of the procedure for creating a computer account in the Active Directory server and this must be referred from external sources in the relevant documentation.
78
79 === computer account password ===
80
81 Password of the computer account.
82
83 == LDAP user lookup ==
84
85 The following settings concern the user lookup after a successful {{smallcaps}}Ntlm{{/smallcaps}} authenication.
86
87 === Port ===
88
89 The port for connecting to the {{smallcaps}}Ldap{{/smallcaps}} server for the user lookup.
90
91 === SSL encryption ===
92
93 Enables SSL encryption when communicating the the {{smallcaps}}Ldap{{/smallcaps}} server.
94
95 === Hop count ===
96
97 The number of hop counts or referrals. Setting this to 0 disables following references.
98
99 === User account (with domain) ===
100
101 Account to be used for looking up users. It must have been granted permission to perform user lookup.
102
103 {{code language="none"}}
104 Example: ldap@example.de
105 {{/code}}
106
107 === User account password ===
108
109 Password of the user account.
110
111 === Base DN für user lookup ===
112
113 {{smallcaps}}Ldap{{/smallcaps}} base DN used for looking up authenticated users.
114
115 {{code language="none"}}
116 Example: ou="users", dc="example", dc="de"
117 {{/code}}
118
119
120
121 == Settings for Kerberos authentication ==
122
123 {{figure image="single_sign_on_kerberos_en.png" width="600"}}
124 User interface for editing the settings for Kerberos authentication. Available only when the license includes this option.
125 {{/figure}}
126
127 Kerberos can be used to authenticate form users. This is often used for internal forms meant only for the employees of a company. The data of the current user can be retrieved from an active directory as well.
128
129 Kerberos authentication is available only when the license includes this option.
130
131 === Use Kerberos ===
132
133 Activate this switch to enable Kerberos authentication.
134
135 === Synchronize with frontend server ===
136
137 When activated, all changes to the configuration will be sent to all available frontend servers.
138
139 === Username ===
140
141 The Window Domain account required for accessing the Key Distribution Center (KDC) and beginning the authentication process.
142
143 Normally this is the user account of the active directory that is setup as a service account.
144
145 {{info}}
146 When no //default_realm// has been specified in the section //[libdefaults]// of the file //krb5.conf//, you will need to enter the username with a domain (FQDN).
147 Example: user@EXCAMPLE.COM
148 {{/info}}
149
150 {{info}}
151 To this user you must, in Active Directory for example, register the **hosts of the urls** and the **computer name** (computer name and FQDN inside the domain) to be used as ServicePrincipalName (SPN) beginning with the service class HTTP. You can find more information [[here>>https://social.technet.microsoft.com/wiki/contents/articles/717.service-principal-names-spn-setspn-syntax.aspx||rel="noopener noreferrer" target="_blank"]] or [[here>>https://docs.microsoft.com/en-us/windows-server/networking/sdn/security/kerberos-with-spn||rel="noopener noreferrer" target="_blank"]].
152 {{/info}}
153
154 === Password ===
155
156 Password of the service account.
157
158 === File krb5.conf ===
159
160 Enter the content of the file //krb5.conf//, ie. the configuration file for Kerberos.
161
162 Among other settings, the available encryption methods, the current real and its mapping to a KDC should be set.
163
164 ==== File structure ====
165
166 The file format is similar to Windows INI files. It contains of individual sections, introduced by their names in brackets. Each section may or may not contain several key-value pairs:
167
168 {{code language="javascript" title=""}}
169 foo = bar
170 {{/code}}
171
172 or
173
174 {{code language="javascript" title=""}}
175 foobar = {
176 foo = bar
177 some = input
178 }
179 {{/code}}
180
181 ==== Section names ====
182
183 * {{litem title="[libdefaults]"}} Contains settings used by the Kerberos library v5.{{/litem}}
184 * {{litem title="[realms]~}~} Realm-specific settings and contact information.{{/litem~}~}
185 * {{litem title="}}A list of supported session key encryption methods that should be requested by the client when performing an AS (authentication server) request. The priority of each method is given by the order in which they have been specified, the first one being the method with the highest priority. Several methods can be separated with commas or spaces.{{/litem}}
186 * ~{~{litem title="default_tgs_enctypes}}A list of supported session key encryption methods that should be requested by the client when performing a TGS (ticket granting server) request. The priority of each method is given by the order in which they have been specified, the first one being the method with the highest priority. Several methods can be separated with commas or spaces.~{~{/litem}}
187 * {{litem title="permitted_enctypes"}}: A list of all allowed session key encryption methods.{{/litem}}
188
189 A simple configuration for the //[libdefaults]// section might look as follows:
190
191 {{code language="javascript" title=""}}
192 [libdefaults]
193 default_realm = EXAMPLE.COM
194 default_tkt_enctypes = aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 camellia256-cts-cmac camellia128-cts-cmac des-cbc-crc des-cbc-md5 des-cbc-md4
195 default_tgs_enctypes = aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 camellia256-cts-cmac camellia128-cts-cmac des-cbc-crc des-cbc-md5 des-cbc-md4
196 permitted_enctypes = aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 camellia256-cts-cmac camellia128-cts-cmac des-cbc-crc des-cbc-md5 des-cbc-md4
197 {{/code}}
198
199 ===== [realms] =====
200
201 Each key in the //[realms]// section represents the name of a Kerberos realm. The value is a list of mappings, defining the properties of each realm. The following properties can be set:
202
203 * kdc: The name or address of a server running a KDC (key distribution center) for this realm, usually the server with the active directory. When necessary, the port number can be specified by appending it separated by a column.
204
205 A simple configuration for the //[realms]// section might look as follows:
206
207 {{code language="javascript" title=""}}
208 [realms]
209 EXAMPLE.COM = {
210 kdc = domain.example.com
211 }
212 {{/code}}
213
214 ===== [domain_realm] =====
215
216 The section //[domain_realm]// contains a mapping from domain names or host names to Kerberos realm names. The key can be a host or domain name, but domain names must be prefixed with a period. The value must be the name of a Kerberos realm for this host or domain. Host and domain names should be spelled with lower case letters.
217
218 A simple configuration for the //[domain_realm]// section might look as follows:
219
220 {{code language="javascript" title=""}}
221 [domain_realm]
222 .example.com = EXAMPLE.COM
223 {{/code}}
224
225 === File login.conf ===
226
227 The content of the file //login.conf//, which contains login-related settings such as the authentication method between clients and servers.
228
229 A sample configuration might look as follows:
230
231 {{code language="java" title=""}}
232 spnego-client {
233 com.sun.security.auth.module.Krb5LoginModule required;
234 };
235
236 spnego-server {
237 com.sun.security.auth.module.Krb5LoginModule required
238 refreshKrb5Config=true
239 storeKey=true
240 isInitiator=false;
241 };
242 {{/code}}
243
244 === Client module name ===
245
246 The name in the //login.conf// file for the client to be used, eg. {{code language="none"}}spnego-client{{/code}}.
247
248 === Server module name ===
249
250 The name in the //login.conf// file for the server to be used, eg. {{code language="none"}}spnego-server{{/code}}.
251
252 {{error}}
253 When you keep getting a HTTP 400 error with Kerberos activated, the most likely cause is that the HTTP header size of the Kerberos ticket exceeds the default header size limit of the application server, eg. Tomcat of JBoss. See the help pages on [[changing the HTTP header size limit>>doc:Formcycle.SystemSettings.TomcatSettings.LimitHTTPHeader]].
254 {{/error}}
255
256 == LDAP user search ==
257
258 The following settings are required to retrieve information about the authenticated user from an {{smallcaps}}Ldap{{/smallcaps}} (MS active directory). This data is then available in the form and can be accessed by JavaScript code.
259
260 === Domain controller host ===
261
262 FQN (fully qualified name) and port of the active directory controller.
263
264 Example: {{code language="none"}}domain.example.com Port: 389{{/code}}
265
266 === SSL connection ===
267
268 When activated, all communications with the LDAP server will be encrypted with SSL.
269
270 === Referral hops ===
271
272 The maximum number of referral hops that may be performed on the LDAP server. Setting this to {{code language="none"}}0{{/code}} deactivates referral hops and no references will be followed.
273
274 === User account (with domain) ===
275
276 This account must have been granted permission to send search queries to the active directory.
277
278 {{info}}
279 This needs to be a username suffixed with the domain.
280 Example: {{code language="none"}}user@EXCAMPLE.COM{{/code}}
281 {{/info}}
282
283 === User account password ===
284
285 Password for the user account.
286
287 === Base DN for user lookup ===
288
289 The LDAP baseDN used for looking up the authenticated user.
290
291 Example: {{code language="none"}}ou="intern", dc="example", dc="com"{{/code}}
292
293 == Theoretical consideration of the connection of several KDCs/domains ==
294
295 If multiple KDC servers or domains are desired for a global Kerberos login ability, this is theoretically possible via the standard MIT Kerberos implementation provided by Java and used by FORMCYCLE. However, the following configurations should be noted here:
296
297 * For each KDC server/domain a separate realm must be defined.
298 * The list to be defined under [domain_realm] must be used to specify which request URL should be handled by which realm.
299 * If cross realm authentication is desired, a cross realm trust must be established. This serves to the purpose that a user from realm A can also log in within the realm B. For example, this can be realized with a direct realm trust where principals are created on each relevant server against the other realms. For the realms A.REALM.COM and B.REALM.COM this would be for exemplary krbtgt/A.REALM.COM@B.REALM.COM and krbtgt/B.REALM.COM@A.REALM.COM.
300 * Use the same name and a strong password for the service principal or configure a keytab file.
301 * To query the correct user data after the Kerberos login, either an LDAP server with access to the whole forest of the realms or the functionality of the client-specific LDAP servers must be configured. It may also be necessary to adjust the responsible LDAP filter.
302
303 == Make user data available to forms ==
304
305 The LDAP user data for the currently authenticated user are stored in the JavaScript object {{code language="none"}}window.XFC_METADATA.user.rawData{{/code}} and can be accessed via JavaScript.
306
307 {{info}}
308 Which data the JSON structure contains under the rawData property depends mainly on the read rights of the LDAP account, which executes the user search in the LDAP system.
309 {{/info}}
310
311 To access the property ~/~/userPrincipalName~/~/ of the user from JavaScript, use the following code:
312
313 {{code language="javascript"}}
314 try {
315 // Auslesen der Property und Anzeige in einem Label
316 var elem = $('[name=txt1]');
317 var ldap = XFC_METADATA.user.rawData;
318 if(ldap.hasOwnProperty('userPrincipalName')) {
319 elem.html(ldap.userPrincipalName);
320 }
321 } catch (err) {}
322 {{/code}}