IBM Support

Enabling HTTP to Use EIM/Kerberos for Protected Pages

Troubleshooting


Problem

How to configure an IBM HTTP Server for Kerberos / Single Sign On (SSO) authentication?

Environment

IBM i OS
IBM HTTP Server

Resolving The Problem

Pre-requisite: Enterprise Identity Mapping (EIM) and Network Authentication Service (NAS) have already been successfully set up on the IBM i. Refer to the following document on how to configure EIM and NAS on the IBM i OS if you have not already completed these steps.
 
https://www.ibm.com/support/pages/node/668073

To add HTTP Kerberos authentication to an IBM i server, complete the following steps divided into the following main categories of focus:
o A new principal name must be added to NAS for Kerberos.
o The HTTP server configuration must be modified to add Kerberos authentication.
o The Web browser options must be changed to allow it to use Kerberos as a means of authentication.
 


Adding a New Principal to NAS

To add a principal to your NAS configuration, do the following:

Step 1: On the iSeries, start a session to Qshell (QSH). Use the following command to add the HTTP keytab entry for NAS:

keytab add HTTP/host.domain@WINDOWSDOMAIN

Note: The format for this principal name should be similar to the EIM principal (krbsvr400/host.domain@WINDOWSDOMAIN).
i.e. 
STRQSH
keytab add HTTP/as400.ibm.domain@IBM.COM

Step 2: A user must be added with the Windows Active Directory Users to be used in conjunction with this principal name. The user can have any password.
DSADD user "cn=activedirectoryusername,cn=users,dc=DOMAIN,dc=COM" -pwd activedirectoryuserpassword -display activedirectoryusername -pwdneverexpires yes -desc "IBM i Kerberos services"
Where activedirectoryusername is any Active Directory username.  The default value is typically set to IBMi_HTTP_1 or IBMi_HTTP_2, etc.
Where activedirectoryuserpassword is the password for the Active Directory user, but this value must match the password for the HTTP/as400.ibm.domain@IBM.COM service principal created on the IBM i under step 1.
i.e.
DSADD user "cn=IBMi_HTTP_1,cn=users,dc=IBM,dc=COM" -pwd mypassword -display IBMi_HTTP_1 -pwdneverexpires yes -desc "IBM i Kerberos services"


Step 3: From an Administrator Microsoft Windows DOS prompt on the Windows Server running Active Directory (and serves as the domain controller), type the following:

KTPASS -MAPUSER activedirectoryusername -PRINC HTTP/host.domain@WINDOWDOMAIN -PASS activedirectoryuserpassword -mapop set -crypto All -ptype KRB5_NT_PRINCIPAL

SETSPN -A HTTP/host.domain.com@WINDOWSDOMAIN activedirectoryusername
Where activedirectoryusername is any Active Directory username.  The default value is typically set to IBMi_HTTP_1 or IBMi_HTTP_2, etc.
Where activedirectoryuserpassword is the password for the Active Directory user, but this value must match the password for the HTTP/as400.ibm.domain@IBM.COM service principal created on the IBM i under step 1.
i.e. 
Start -> Run -> cmd
KTPASS -MAPUSER IBMi_HTTP_1 -PRINC HTTP/as400.ibm.com@IBM.COM -PASS mypassword -mapop set -crypto All -ptype KRB5_NT_PRINCIPAL

SETSPN -A HTTP/as400.ibm.com@IBM.COM IBMi_HTTP_1


Step 4: From Qshell on the iSeries, test to determine if everything is correct for the new principal name. Type the following to test:

kinit -k HTTP/host.domain@WINDOWSDOMAIN

If everything is satisfactory, you will get a $ prompt without errors.
i.e.
STRQSH
kinit -k HTTP/as400.ibm.com@IBM.COM
$


Adding Kerberos Authentication to an HTTP Server Instance

Step 1: In the HTTP Server GUI, select the server that you would like to work with and the particular server area that you want to secure:
NOTE:  For the Server Area, you will need to select a "Directory" or "Location" area for the Authentication tab to be available to select.

image 10841

Step 2: On the left menu bar, click the Security Link, and click on the Authentication Tab. One of the options is for Kerberos:

image 10845

Step 3: After selecting Kerberos, click OK. This updates the directory container to look similar to the following:
 
  <Directory /www/apachedft/htdocs>
   Require all granted
   Require valid-user
   PasswdFile %%KERBEROS%%
   AuthType Kerberos
</Directory>

Step 4: End and restart the HTTP Server instance.

Now your HTTP Server should be set up to use Kerberos and the iSeries is set up to allow the HTTP Server to use Kerberos in NAS. The last step is to get the Web browser to also use it.

Step 5: The web browser needs to be configured to send the Kerberos ticket for authentication:
 
  • Configuring Mozilla Firefox

    The following steps are available for the latest version of Firefox:
    https://developer.mozilla.org/en-US/docs/Mozilla/Integrated_authentication

    a. Open Mozilla Firefox.
    b. Specify about:config in the Go to a website field.
    c. Select "I'll be careful, I promise!" in the "This might void your warranty!" window.
    d. Specify "network.n" in the Filter field.
    e. Select the "network.negotiate-auth.delegation-uris" preference in the list of preferences.
    f. Double click to modify the value.
    g. Specify the name of your IBM i system in the input field. For example, specify:

    hostnameA,hostnameB,hostnameC
    i.e. as400.ibm.com,as4002.ibm.com,as4003.ibm.com

    h. Use a comma to separate each URL.
    i. Select OK.
    j. Select the "network.negotiate-auth.trusted-uris" preference in the list of preferences.
    k. Double click to modify the value.
    l. Specify the same URL(s) appear in step 7, in the input field.

    Mozilla Firefox about:config scree showing network.negotiate-auth.delegation.urls configuration for IBM i hosts
  • Configuring Chrome

    The following steps are available for the latest version of Chrome:
    https://cloud.google.com/docs/chrome-enterprise/policies/#httpAuthentication

    The procedure to enable SPNEGO on Chrome is like Windows 10. After you complete steps a,b, and c in “Configuring Edge on Windows 10 to enable SPNEGO”, perform the following special steps for Chrome:

    a. Open Microsoft Registry Editor by typing regedit.exe in Run window.
    b. Google Chrome uses a few different policies to enable SPNEGO support.  IBM recommends all 4 policies are added to your browser even though some are deprecated.  Adding all 4 policies ensures all required policies are set to enable SPENGO support.

    c. The policies are stored in the Windows registry under HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome. If the key at the end of the path (Google or Chrome) does not exist, you can manually create it (Right-click -> New -> String Value). The Type of the policy is a String Value (REG_SZ).
    d. Multiple servers are separated with commas.
    e. Wildcards (*) are allowed in the names.
    f.  The value of the policy would be the web domain being accessed. i.e. *.rch.stglabs.ibm.com
    g. Ensure all 4 policies, AuthNegotiateDelegateAllowlist, AuthNegotiateDelegateallowlist, AuthServerAllowlist, and AuthServerallowlist, are added.

    image 8688
    You can confirm your browser policies by entering "chrome://policy" in the browser address bar and press ENTER.  The browser policies in blue are currently active and being used in the current browser session.


     

  • Configuring Edge on Windows 10

    The following steps are available for the latest version of Edge.

    a. Open Security zones in IE (Tools → Internet Options → Security → Local intranet), then add the name of your IBM i system to Local intranet:

    Shows Internet Options, Security, Local Intranet, Advanced imageImage showing where you add the trusted websites for the Local Intranet zone.



    b. Change Local intranet security settings as follows:

    Image of Local Intranet security settings for Trusted Sites zone
    The following steps are available for the version 77 and later of the Edge browser:
    https://docs.microsoft.com/en-us/deployedge/microsoft-edge-policies
     
    The procedure to enable SPNEGO in Edge is like Windows 10. After you complete steps a,b, and c in “Configuring Edge on Windows 10 to enable SPNEGO”, perform the following special steps for Edge:
     
    a. Open Microsoft Registry Editor by typing regedit.exe in Run window.
    b. Microsoft Edge uses a few different policies to enable SPNEGO support.  IBM recommends both policies are added to your browser.  Adding both policies ensures all required policies are set to enable SPENGO support.
    c. The policies are stored in the Windows registry under HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Edge. If the key at the end of the path (Edge) does not exist, you can manually create it (Right-click -> New -> String Value). The Type of the policy is a String Value (REG_SZ).
    d. Multiple servers are separated with commas.
    e. Wildcards (*) are allowed in the names.
    f.  The value of the policy would be the web domain being accessed. i.e. *.rch.stglabs.ibm.com
    g. Confirm both policies, AuthNegotiateDelegateAllowlist and AuthServerAllowlist, are added.

    image 8687


     

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CGqAAM","label":"IBM i HTTP Server"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0;7.2.0;7.3.0;7.4.0;and future releases"}]

Historical Number

325250721

Document Information

Modified date:
20 June 2022

UID

nas8N1016293