Bookmark this page

Lab: Working with Single Sign-on Technology

Configure the Red Hat single sign-on technology to use IdM as an identity provider.

Outcomes

  • Configure the Red Hat single sign-on technology to use IdM LDAP.

  • Ensure that IdM users can use single sign-on (SSO).

As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available:

[student@workstation ~]$ lab start compreview-sso

Specifications

  • Register the utility machine as an IdM client. Do not use DNS discovery. Use the following values:

    DescriptionValue
    Realm LAB.EXAMPLE.COM
    Domain lab.example.com
    Server idm.lab.example.com
  • Configure the SSO server on the utility machine to use IdM as an identity provider with the following settings:

    SettingValue
    Console Display Name review
    Priority0
    Import Users ON
    Edit Mode READ_ONLY
    Sync RegistrationsOff
    Vendor Red Hat Directory Server
    Username LDAP attribute uid
    RDN LDAP attribute uid
    UUID LDAP attribute ipaUniqueID
    User Object Classes inetOrgPerson, organizationalPerson
    Connection URL ldaps://idm.lab.example.com:636
    Users DN cn=users,cn=accounts,dc=lab,dc=example,dc=com
    Search ScopeOne Level
    Bind Typesimple
    Bind DN uid=admin,cn=users,cn=accounts,dc=lab,dc=example,dc=com
    Bind Credential RedHat123^
  • Verify that the idmuser03 user can authenticate to IdM using kinit, with RedHat123^ as the password.

  • From workstation, verify that the SSO server on utility is using idm as an identity provider. Use the following curl command to confirm that the idmuser03 user can get an OpenID Connect token from the SSO server on utility by authenticating with their IdM password:

    [student@workstation ~]$ curl -d 'client_id=admin-cli' -d "username=idmuser03" \
      -d "password=RedHat123^" -d 'grant_type=password' \
      "http://utility:8080/auth/realms/review/protocol/openid-connect/token"
  1. Log in to the utility machine and become the root user to configure the SSO server as an IdM client:

    [student@workstation ~]$ ssh utility
    [student@utility ~]$ sudo -i
    [sudo] password for student: student
    1. Register the SSO server to the LAB.EXAMPLE.COM realm:

      [root@utility ~]# ipa-client-install --domain lab.example.com \
        --server idm.lab.example.com --realm LAB.EXAMPLE.COM
      This program will set up IPA client.
      Version 4.10.0
      
      ...output omitted...
      Proceed with fixed values and no DNS discovery? [no]: yes
      Do you want to configure chrony with NTP server or pool address? [no]: Enter
      Client hostname: utility.lab.example.com
      Realm: LAB.EXAMPLE.COM
      ...output omitted...
      
      Continue to configure the system with these values? [no]: yes
      ...output omitted...
      
      Time synchronization was successful.
      User authorized to enroll computers: admin
      Password for admin@LAB.EXAMPLE.COM: RedHat123^
      Successfully retrieved CA cert
      ...output omitted...
      
      Client configuration complete.
      The ipa-client-install command was successful
  2. Navigate to the SSO web console at http://utility.lab.example.com:8080 and configure the ldap realm to use the IdM LDAP server. Use the admin user and RedHat123^ as the password to authenticate.

    1. Navigate to the SSO web console at http://utility.lab.example.com:8080 and click Administration Console. Use the admin user and RedHat123^ as the password to authenticate.

    2. Navigate to ConfigureRealm Settings and verify you are in the review realm.

    3. Navigate to ConfigureUser Federation under the Configure section.

      Figure 11.1: User Federation
    4. Click Add provider, choose ldap, and add the following configuration settings:

      SettingValue
      Console Display Name review
      Priority0
      Import Users ON
      Edit Mode READ_ONLY
      Sync Registrations Off
      Vendor Red Hat Directory Server
      Username LDAP attribute uid
      RDN LDAP attribute uid
      UUID LDAP attribute ipaUniqueID
      User Object Classes inetOrgPerson, organizationalPerson
      Connection URL ldaps://idm.lab.example.com:636
      Users DN cn=users,cn=accounts,dc=lab,dc=example,dc=com
      Search ScopeOne Level
      Bind Typesimple
      Bind DN uid=admin,cn=users,cn=accounts,dc=lab,dc=example,dc=com
      Bind Credential RedHat123^
    5. Click Save and then click Synchronize all users.

      The console shows a synchronization success message.

  3. Log in to the client machine and start a Kerberos session.

    1. Exit the utility machine and log in to the client machine as the student user:

      [root@utility ~]# exit
      logout
      [student@utility ~]$ exit
      logout
      Connection to utility closed.
      [student@workstation ~]$ ssh client
    2. Start a Kerberos session as the idmuser03 user with RedHat123^ as the password:

      [student@client ~]$ kinit idmuser03
      Password for idmuser03@LAB.EXAMPLE.COM: RedHat123^
  4. Verify that SSO uses IdM as an identity provider by obtaining an OpenID Connect token.

    1. Exit the client machine:

      [student@client ~]$ exit
      logout
      Connection to client closed.
      [student@workstation ~]$
    2. From the workstation machine, use the following curl command to get an OpenID Connect token from the SSO server for the idmuser03 in the review SSO realm:

      [student@workstation ~]$ curl -d 'client_id=admin-cli' -d "username=idmuser03" \
        -d "password=RedHat123^" -d 'grant_type=password' \
        "http://utility:8080/auth/realms/review/protocol/openid-connect/token"
      {"access_token":"eyJhbGciOi
      ...output omitted...

Evaluation

As the student user on the workstation machine, use the lab command to grade your work. Correct any reported failures and rerun the command until successful.

[student@workstation ~]$ lab grade compreview-sso

Finish

On the workstation machine, change to the student user home directory and use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish compreview-sso
Revision: rh362-9.1-4c6fdb8