Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
tutorial:adm:sso_ad_domain [2019/10/04 09:06]
kopro [Enable authentication in browsers] add information about automatic logon
tutorial:adm:sso_ad_domain [2020/06/12 16:27]
apeterova
Line 2: Line 2:
  
 CzechIdM supports Single-Sign-On of the AD domain users. The mechanism uses web server, which handles the Kerberos authentication and provides the login of the authenticated user in the HTTP header. Then CzechIdM processes this header and authenticates the user automatically. CzechIdM supports Single-Sign-On of the AD domain users. The mechanism uses web server, which handles the Kerberos authentication and provides the login of the authenticated user in the HTTP header. Then CzechIdM processes this header and authenticates the user automatically.
 +
 +<note important>The SSO implementation works by looking up a username returned by Kerberos in IdM. This means that the user must have the same sAMAccountName in AD and username in IdM. Also, AD is not case-sensitive but IdM is, i. e., if your sAMAccountName is "jnovak", you can log in to AD as "JNovak" but this is not the case in IdM. **Make sure that usernames in IdM are the same as sAMAccountNames in AD, otherwise, SSO will fail.**</note>
  
 If the user is the Application Admin (e.g. has assigned the role superAdminRole), SSO authentication is disabled for security reasons. If the user is the Application Admin (e.g. has assigned the role superAdminRole), SSO authentication is disabled for security reasons.
Line 89: Line 91:
 </code> </code>
  
-Add Kerberos configuration and setting the ''REMOTE_USER'' header inside the **VirtualHost tag** in ''/etc/httpd/conf.d/ssl.conf'':+Add Kerberos configuration and setting the ''REMOTE_USER'' header inside the **VirtualHost tag** in ''/etc/httpd/conf.d/ssl.conf''. And exlude "/idm/api/v1/status" from authentication so everyone can access it:
 <code> <code>
        <Location /idm>        <Location /idm>
Line 103: Line 105:
  
        RequestHeader set REMOTE_USER %{REMOTE_USER}s        RequestHeader set REMOTE_USER %{REMOTE_USER}s
 +       
 +       <Location /idm/api/v1/status>
 + Satisfy Any
 +       </Location>
 </code> </code>
 This configuration enables **Negotiate** (the users logged in domain computer will be automatically authenticated - this must be enabled in the browser), as well as **Basic Auth** (the user, who is not logged in domain computer, will be first prompted for username and password with the message "Kerberos Login" and the credentials will be sent to AD for authentication). Negotiate can be disabled by KrbMethodNegotiate, Basic Auth can be disabled by KrbMethodK5Passwd. This configuration enables **Negotiate** (the users logged in domain computer will be automatically authenticated - this must be enabled in the browser), as well as **Basic Auth** (the user, who is not logged in domain computer, will be first prompted for username and password with the message "Kerberos Login" and the credentials will be sent to AD for authentication). Negotiate can be disabled by KrbMethodNegotiate, Basic Auth can be disabled by KrbMethodK5Passwd.
Line 150: Line 156:
   * The keytab shouldn't be generated with only some ciphers, so use ''-crypto all'' in the command as above.   * The keytab shouldn't be generated with only some ciphers, so use ''-crypto all'' in the command as above.
  
-Usual messages in Apache error log:+Usual messages in Apache error logs:
   * ''krb5\_get\_init\_creds\_password() failed: Cannot contact any KDC for requested realm'': make sure that DC in /etc/krb5.conf kdc communicates on port 88:   * ''krb5\_get\_init\_creds\_password() failed: Cannot contact any KDC for requested realm'': make sure that DC in /etc/krb5.conf kdc communicates on port 88:
 <code bash> <code bash>
Line 158: Line 164:
   * ''krb5\_get\_init\_creds\_password() failed: Preauthentication failed'': the given user has different password.   * ''krb5\_get\_init\_creds\_password() failed: Preauthentication failed'': the given user has different password.
   * ''gss\_accept\_sec\_context() failed: No credentials were supplied, or the credentials were unavailable or inaccessible (, Unknown error)'': the client doesn't trust the address of IdM, i.e. it isn't in Trusted sites in Internet Explorer.   * ''gss\_accept\_sec\_context() failed: No credentials were supplied, or the credentials were unavailable or inaccessible (, Unknown error)'': the client doesn't trust the address of IdM, i.e. it isn't in Trusted sites in Internet Explorer.
 +  * ''gss\_accept\_sec\_context() failed: An unsupported mechanism was requested (, Unknown error)'': the client doesn't trust the address of IdM, i.e. it isn't in Trusted sites in Internet Explorer. (probably)
 +  * ''request failed: error reading the headers'' (and HTTP response 400): This happens to users who are members of many AD groups (e.g. more than 100) and use IE. More precisely: the Authorization header (holding Kerberos ticket) is longer than the max size of HTTP headers in the Apache webserver. Some browsers, e.g. Chrome, cuts off the tickets, but IE doesn't. You may increase the limit of the header size in Apache HTTP Server by the [[https://httpd.apache.org/docs/2.2/mod/core.html#limitrequestfieldsize|LimitRequestFieldSize]] directive. However, the limit may be also on the application server (Apache Tomcat, JBoss). Then you can unset the header so it's not proxied to the application server - put ''RequestHeader unset Authorization'' in the ''/etc/httpd/conf.d/ssl.conf''.
   * ''failed to verify krb5 credentials: Key table entry not found'': something is wrong with the keytab. Try to compare its version (KVNO) and the version of Kerberos ticket:   * ''failed to verify krb5 credentials: Key table entry not found'': something is wrong with the keytab. Try to compare its version (KVNO) and the version of Kerberos ticket:
 <code> <code>
Line 176: Line 184:
   * ''krb5\_rd\_req() failed when verifying KDC'' followed by ''failed to verify krb5 credentials: Permission denied'': Bad permissions on the keytab file. All httpd processes must have ''read'' access to the keytab.   * ''krb5\_rd\_req() failed when verifying KDC'' followed by ''failed to verify krb5 credentials: Permission denied'': Bad permissions on the keytab file. All httpd processes must have ''read'' access to the keytab.
  
 +===== See also ===== 
 +[[tutorial:adm:sso_configuring_tips|Tips for configuring SSO on Windows (can be useful on Linux servers as well)]]
  • by apeterova