jason_petty
Tera Expert

I work a lot with customers setting up their SAML SSO solution. There have been a number of IDPs that the customers I have worked with use and I hardly ever get to see that side of the configuration. I wanted to understand what they had to do in order to set up their IDP to work with ServiceNow. I have documented the steps that I took to install and configure OpenAM (Formerly known as OpenSSO) to work with ServiceNow as my SAML 2.0 IDP. These instructions assume you are setting up your own virtual machine locally.

Setup Your Virtual Machine's Host file

  1. Bring up a Linux VM in your favorite hypervisor
  2. Set your host name in your network settings to something you can use in your hosts file like openamtest
  3. Modify your /etc/hosts file to have an entry like this:

    1. 192.168.1.106 openamtest.org openamtest


Install Open DJ
  1. Download OpenDJ-2.4.6 from Here (Get the ZIP file)
  2. Unzip the file
  3. Run "./setup --cli"

    1. Put in an LDAP syntax for the root user for your LDAP Directory (cn=Directory Manager)

      1. What would you like to use as the initial root user DN for the Directory Server? [cn=Directory Manager]:

    2. Set to port to something like 1389

      1. On which port would you like the Directory Server to accept connections from LDAP clients? [1389]:

    3. Set the Administration Connector port to 4444

      1. On which port would you like the Administration Connector to accept connections? [4444]:

    4. Create the base DNs of the server

      1. Do you want to create base DNs in the server? (yes / no) [yes]:

    5. Provide the base DN:

      1. Provide the base DN for the directory data: [dc=example,dc=com]:

    6. Only Create Base Entry:

      1. Options for populating the database:

        1) Only create the base entry
        2) Leave the database empty
        3) Import data from an LDIF file
        4) Load automatically-generated sample data

        Enter choice [1]: 1

    7. Don't enable SSL:

      1. Do you want to enable SSL? (yes / no) [no]:

    8. Don't enable Start TLS:

      1. Do you want to enable Start TLS? (yes / no) [no]:

    9. Chose Yes to start server when configuration is complete:

      1. Do you want to start the server when the configuration is completed? (yes / no) [yes]:

    10. When you see the setup summary, choose "Set up server with parameters above":

      1. Setup Summary
        =============
        LDAP Listener Port: 1389
        Administration Connector Port: 4444
        LDAP Secure Access: disabled
        Root User DN: cn=Directory Manager
        Directory Data: Create New Base DN dc=example,dc=com.
        Base DN Data: Only Create Base Entry (dc=example,dc=com)

        Start Server when the configuration is completed

        What would you like to do?

        1) Set up the server with the parameters above
        2) Provide the setup parameters again
        3) Print equivalent non-interactive command-line
        4) Cancel and exit

        Enter choice [1]:

    11. After it is done, you will see this:

      1. Configuring Directory Server ..... Done.
        Creating Base Entry dc=example,dc=com ..... Done.
        Starting Directory Server ........ Done.


        To see basic server configuration status and configuration you can launch /opt/OpenDJ-2.4.6/bin/status



    Install Tomcat
    1. Download Tomcat 7 from Here (Get the Zip File)
    2. Unzip the file
    3. CD to the apache/bin directory
    4. Do a chmod 755 * in that folder
    5. Modify the catalina.sh file and put in this line somewhere

      1. JAVA_OPTS="-Xmx1024m -XX:MaxPermSize=256m"

    6. Run "./startup.sh"


    Install OpenAM (Formerly known as OpenSSO)
    1. Download OpenAM 10.0.1 from Here (Get the Zip File)
    2. Unzip the file
    3. Copy the opensso/deployable-war/opensso.war to the apache/webapps directory

      1. It will automatically deploy the war file and extract it to a folder in the webapps directory

    4. Go to http://ipaddressOfVm:8080/opensso/config/options.htm
    5. Click on Create New Configuration
    6. Type in a password on the first screen twice that you want to set


    7. On the next screen, make sure your ip address is in the first field like this:

      1. http://192.168.1.102:8080
      2. Cookie Domain should be 192.168.1.102
      3. Leave the rest default



    8. On the next screen, leave everything default and click next


    9. On the next screen, Choose OpenDJ as the type

      1. Hostname is localhost
      2. Set the right port 1389
      3. Set the Context to dc=example,dc=com like you did when setting up OpenDJ
      4. Type in a password
      5. Click next


    10. Leave the next option set to no and click next


    11. Type in a password twice - it has to be different than the one you set in step 6 then click Next


    12. Click the Create Configuration button and let it run the configuration


    13. When the configuration finishes, click "proceed to login" or just login at this address: http://ipaddressOfVm:8080/opensso/

      1. username: amAdmin
      2. password: your password you set up in step 6 above

    14. Create Users in your IDP

      1. Click on Access Control tab


      2. Click on the link "(Top Level Realm)" in the list of realms


      3. Click on Subjects tab


      4. Click on the New button


      5. Put in the id, First Name, Last Name, Password twice and then click OK


      6. Now open the details of that user you just created and put in an email that will match a user in ServiceNow


      7. Save
      8. Click "Back to Subjects" button
      9. Click "Back to Access Control" button

    15. Increase the buffer length so signing won't fail

      1. Click on Configuration tab


      2. Click on Global sub-tab
      3. Click on SAMLv2 Service Configuration property


      4. Add a 0 to the end of the Buffer Length value (last value)


      5. Save
      6. Click "Back to Service Configuration" button

    16. Create your IDP

      1. Click on Common Tasks Tab
      2. Click on "Create Hosted Identity Provider"


      3. Set the Signing key to "test"
      4. Type in the "Circle of Trust" field a name you want to name your IDP like "OpenSSOIdP"


      5. Click Configure
      6. Click Finish

    17. Get settings from OpenAM and set all your settings in your ServiceNow instance

      1. Click on Federation tab
      2. In the "Entity Providers" section, click on the hyperlink of your IDP's ip address


      3. Click on the Services tab
      4. Copy the appropriate values from here to your ServiceNow instance


      5. Set the values in your ServiceNow instance


      6. Click the "Back" button
      7. Put the certificate in ServiceNow (This is the certificate for OpenSSO)




      8. -----BEGIN CERTIFICATE-----
        MIICQDCCAakCBEeNB0swDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNh
        bGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMQwwCgYDVQQKEwNTdW4xEDAOBgNVBAsTB09w
        ZW5TU08xDTALBgNVBAMTBHRlc3QwHhcNMDgwMTE1MTkxOTM5WhcNMTgwMTEyMTkxOTM5WjBnMQsw
        CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLU2FudGEgQ2xhcmExDDAK
        BgNVBAoTA1N1bjEQMA4GA1UECxMHT3BlblNTTzENMAsGA1UEAxMEdGVzdDCBnzANBgkqhkiG9w0B
        AQEFAAOBjQAwgYkCgYEArSQc/U75GB2AtKhbGS5piiLkmJzqEsp64rDxbMJ+xDrye0EN/q1U5Of+
        RkDsaN/igkAvV1cuXEgTL6RlafFPcUX7QxDhZBhsYF9pbwtMzi4A4su9hnxIhURebGEmxKW9qJNY
        Js0Vo5+IgjxuEWnjnnVgHTs1+mq5QYTA7E6ZyL8CAwEAATANBgkqhkiG9w0BAQQFAAOBgQB3Pw/U
        QzPKTPTYi9upbFXlrAKMwtFf2OW4yvGWWvlcwcNSZJmTJ8ARvVYOMEVNbsT4OFcfu2/PeYoAdiDA
        cGy/F2Zuj8XJJpuQRSE6PtQqBuDEHjjmOQJ0rV/r8mO1ZCtHRhpZ5zYRjhRC9eCbjx9VrFax0JDC
        /FfwWigmrW0Y0Q==
        -----END CERTIFICATE-----


    18. Create your SP

      1. Click on the Metadata module in ServiceNow
      2. Copy it and save it to a file for later
      3. Click on the Common Tasks tab
      4. Click on "Register Remote Service Provider"


      5. Click on the File radio button
      6. Click "Upload..." button"


      7. Browse to the file from step 2
      8. Click "Upload File" button


      9. Click "Configure" button
      10. Click "OK" button when it pops up the successfully configured SP dialog



    Try to Login to ServiceNow

6 Comments