Single Signon
Single Signon
Single Signon
7.2
Security
Single sign-on
IBM
Note
Before using this information and the product it supports, read the information in “Notices” on page
71.
This edition applies to IBM i 7.2 (product number 5770-SS1) and to all subsequent releases and modifications until
otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor
does it run on CISC models.
This document may contain references to Licensed Internal Code. Licensed Internal Code is Machine Code and is
licensed to you under the terms of the IBM License Agreement for Machine Code.
© Copyright International Business Machines Corporation 2004, 2013.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents
Single sign-on....................................................................................................... 1
What's new for IBM i 7.2..............................................................................................................................1
PDF file for Single sign-on............................................................................................................................1
Concepts.......................................................................................................................................................2
Single sign-on overview..........................................................................................................................2
Authentication........................................................................................................................................ 3
Authorization.......................................................................................................................................... 3
Domains.................................................................................................................................................. 5
Identity mapping.................................................................................................................................... 6
IBM i enablement................................................................................................................................... 7
ISV enablement...................................................................................................................................... 8
Scenarios...................................................................................................................................................... 9
Scenario: Creating a single sign-on test environment...........................................................................9
Completing the planning work sheets............................................................................................12
Creating a basic single sign-on configuration for System A.......................................................... 15
Adding System A service principal to the Kerberos server............................................................17
Creating home directory for John Day on System A...................................................................... 18
Testing network authentication service configuration on System A............................................. 18
Creating an EIM identifier for John Day......................................................................................... 19
Testing EIM identity mappings....................................................................................................... 19
Configuring IBM i Access Client Solutions applications to use Kerberos authentication.............20
Verifying network authentication service and EIM configuration................................................. 20
(Optional) Postconfiguration considerations................................................................................. 21
Scenario: Enabling single sign-on for IBM i......................................................................................... 21
Completing the planning work sheets............................................................................................26
Creating a basic single sign-on configuration for System A.......................................................... 32
Configuring System B to participate in the EIM domain................................................................ 34
Adding both IBM i service principals to the Kerberos server........................................................ 36
Creating user profiles on System A and System B.........................................................................37
Creating home directories on System A and System B................................................................. 37
Testing network authentication service on System A and System B............................................ 37
Creating EIM identifiers for two administrators, John Day and Sharon Jones............................. 38
Creating identifier associations for John Day................................................................................ 38
Creating identifier associations for Sharon Jones......................................................................... 40
Creating default registry policy associations................................................................................. 41
Enabling registries to participate in lookup operations and to use policy associations............... 42
Testing EIM identity mappings....................................................................................................... 43
Configuring IBM i Access Client Solutions applications to use Kerberos authentication.............46
Verifying network authentication service and EIM configuration................................................. 46
(Optional) Postconfiguration considerations................................................................................. 47
Scenario: Enabling single sign-on for ISV applications.......................................................................47
Completing the planning prerequisite worksheet......................................................................... 49
Writing a new application or change an existing application........................................................ 49
Creating a single sign-on test environment................................................................................... 50
Testing your application..................................................................................................................50
Example: ISV code..........................................................................................................................50
Planning for single sign-on ....................................................................................................................... 57
Requirements for configuring a single sign-on environment.............................................................. 58
Single sign-on planning worksheets.................................................................................................... 59
Configuring single sign-on......................................................................................................................... 62
Managing single sign-on............................................................................................................................ 64
iii
Troubleshooting single sign-on................................................................................................................. 64
Related information................................................................................................................................... 68
Notices................................................................................................................71
Programming interface information.......................................................................................................... 72
Trademarks................................................................................................................................................ 72
Terms and conditions.................................................................................................................................73
iv
Single sign-on
If you are looking for a way to eliminate the number of passwords that your users must use and that your
administrators must manage, then implementing a single sign-on environment might be the answer you
need.
This information presents a single sign-on solution for IBM® i, which uses network authentication service
(IBM's implementation of the Kerberos V5 standard from MIT) paired with Enterprise Identity Mapping
(EIM). The single sign-on solution reduces the number of sign-ons that a user must perform, as well as
the number of passwords that a user requires to access multiple applications and servers.
Note: Read the “Code license and disclaimer information” on page 68 for important legal information.
Authentication
Authentication is part of a single sign-on solution because it identifies who a user is and then proves it,
typically based on a user name and password.
The process of authentication is different from the process of authorization, in which an entity or a person
is granted or denied access to a network or system resource.
A single sign-on environment streamlines the process and management of authentication for users and
administrators. Because of the way single sign-on is implemented on your system, not only do users
need to supply fewer IDs and passwords but, if you choose to, they do not even need to have a IBM
i passwords. Administrators need to troubleshoot identity and password problems less often because
users need to know fewer identities and passwords to access the systems that they use.
Interfaces that are enabled for single sign-on require the use of Kerberos as the authentication method.
Network authentication service is the IBM i implementation of the Kerberos authentication function.
Network authentication service provides a distributed authentication mechanism through the use of a
Kerberos server, also called a key distribution center (KDC), which creates service tickets that are used to
authenticate the user (a principal in Kerberos terms) to some service on the network. The ticket provides
proof of the principal's identity to other services that the principal requests in the network.
Note: If you are an application developer, it is possible to make use of other types of authentication
methods as you enable your applications to work in a single sign-on environment. For example, you can
create applications that use an authentication method, such as digital certificates, in conjunction with EIM
APIs to enable your application to participate in a single sign-on environment.
Related concepts
Single sign-on overview
A single sign-on solution is designed to alleviate the use of having multiple user names and passwords
across your enterprise. Implementing a single sign-on solution benefits user, administrators, and
application developers.
Authorization
Authorization is a process in which a user is granted access to a network or system resource.
Related information
Network authentication service
Authorization
Authorization is a process in which a user is granted access to a network or system resource.
Most enterprises use a two-stage process to allow users to access network assets. The first stage
of this process is authentication. Authentication is a process in which a user identifies themselves to
the enterprise. Typically this requires the user to provide an identifier and a password to the security
component of the enterprise. The security component verifies the information that it receives. After a
successful authentication, the user is issued a process they can use, a credential, or a ticket to use to
demonstrate that they have already authenticated to the enterprise. An example of a user authentication
is the ID and password challenge on an IBM i Access Client Solutions 5250 emulator connection. After
Single sign-on 3
successful authentication, the user is assigned a job that runs under their user ID. The second stage is
authorization. It is important to know the distinction between authentication and authorization.
Authorization is the process of determining if an entity or person has the authority to access an asset
within an enterprise. Authorization checks are done after a user has authenticated to the enterprise,
because authorization requires that the enterprise knows who is trying to gain access. Authorization
checking is mandatory and occurs as part of the system. Users are typically unaware that authorization
checks occur unless their access is denied. An example of authorization occurs when a user uses
the command CRTSRCPF QGPL/MYFILE. The system performs authorization checks on the command
CRTSRCPF and the library QGPL. If the user does not have the authority to access the command and the
library, the user's request fails.
An enterprise that has implemented the IBM i single sign-on solution uses Enterprise Identity Mapping
(EIM) to manage user access to enterprise assets. While EIM does not perform authorization checks, the
identity mapping establishes the local identities for users that have successfully authenticated into the
enterprise. The source (or user) receives access and privileges on the target system through the local ID.
For example, assume you have the following simple enterprise environment:
It is important that all of the associations between users and resources are set up correctly. If the
associations are incorrect, users will have access to data outside the scope of their responsibilities, which
is a security concern for most enterprises. System administrators need to be very careful when creating
the EIM mappings and ensure that they map users to the correct local registry IDs. For example if you
mapped the IT Programmer, Daryl La, to the SecOfficer ID instead of Susan Doe, you could compromise
the security of the system. This reinforces the fact that security administrators must still take care in
securing the target systems within the enterprise.
Related concepts
Single sign-on overview
A single sign-on solution is designed to alleviate the use of having multiple user names and passwords
across your enterprise. Implementing a single sign-on solution benefits user, administrators, and
application developers.
Authentication
Domains
EIM and Windows domains are used to implement a single sign-on environment.
Although both the EIM domain and Windows domain contain the word domain, they have very different
definitions. Use the following descriptions to understand the differences between these two types of
domains.
EIM domain
An EIM domain is a collection of data, which includes the EIM identifiers, EIM associations, and EIM
user registry definitions that are defined in that domain. This data is stored in a Lightweight Directory
Access Protocol (LDAP) server, such as the IBM Tivoli® Directory Server for IBM i, which can run on any
system in the network, defined in that domain. Administrators can configure systems (EIM clients),
such as IBM i, to participate in the domain so that systems and applications can use domain data for
EIM lookup operations and identity mapping.
Windows domain
In the context of single sign-on, a Windows domain is a Windows network that contains several
systems operating as clients and servers and a variety of services and applications used by the
systems. The following are some of the components pertinent to single sign-on that you might find
within a Windows domain:
Realm
A realm is a collection of machines and services. The main purpose of a realm is to authenticate
clients and services. Each realm uses a single Kerberos server to manage the principals for that
particular realm.
Kerberos server
A Kerberos server, also known as a key distribution center (KDC), is a network service that
resides on the Windows server and provides tickets and temporary session keys for network
authentication service. The Kerberos server maintains a database of principals (users and
services) and their associated secret keys. It is composed of the authentication server and the
ticket granting server. A Kerberos server uses Microsoft Windows Active Directory to store and
manage the information in a Kerberos user registry.
Microsoft Windows Active Directory
Microsoft Windows Active Directory is an LDAP server that resides on the Windows server along
with the Kerberos server. The Active Directory is used to store and manage the information in a
Kerberos user registry. Microsoft Windows Active Directory uses Kerberos authentication as its
default security mechanism. Therefore, if you are using Microsoft Active Directory to manage your
users, you are already using Kerberos technology.
Related concepts
Identity mapping
Identity mapping is the process of using defined relationships between user identities in an enterprise
such that applications and operating systems can map from one user identity to another, related user
identity.
Related information
Enterprise Identity Mapping
Enterprise Identity Mapping Concepts
Single sign-on 5
Identity mapping
Identity mapping is the process of using defined relationships between user identities in an enterprise
such that applications and operating systems can map from one user identity to another, related user
identity.
The ability to map between identities is essential to single sign-on enablement, as it allows you to
separate the process of authentication from that of authorization. Identity mapping allows a user to log on
to a system and be authenticated based on the credentials of one user identity and then be able to access
a subsequent system or resource without having to supply new credentials. Instead, the authenticated
identity is mapped to the appropriate identity for the requested system or resource. Not only does this
make life easier for the user, who need not supply a second credential for logging on to the second
system, but the authorizations he has for the second system are handled by the appropriate identity.
To implement single sign-on, you need to create certain EIM data within the EIM domain to define the
relationships needed to appropriately map identities within your single sign-on environment. Doing so
ensures that EIM can use that data to perform mapping lookup operations for single sign-on. You use
EIM to create associations to define the relationships between user identities in your enterprise. You can
create both identifier associations and policy associations to define these relationships depending on how
you want identity mapping to work.
Identifier associations
Identifier associations allow you to define a one-to-one relationship between user identities through an
EIM identifier defined for an individual. Identifier associations allow you to specifically control identity
mapping for user identities and are especially useful when individuals have user identities with special
authorities and other privileges. These associations dictate how the user identities are mapped from
one to another. In a typical identity mapping situation, you create source associations for authenticating
user identities and target associations to map the authenticating user identity to the appropriate user
identities for authorized access to other systems and resources. For example, you might typically create
the following identifier associations between an EIM identifier and corresponding user identities for a
user:
• A source association for the user's Kerberos principal, which is the identity with which the user logs
into, and is authenticated to, the network.
• Target associations for each user identity in the various user registries that the user accesses, such as
IBM i user profiles.
The following example illustrates how the identity mapping process works for identifier associations.
The security administrator at Myco, Inc creates an EIM identifier (John Day) for an employee. This
EIM identifier uniquely identifies John Day in the enterprise. The administrator then creates identifier
associations between the John Day identifier and two user identities that he routinely uses in the
enterprise. These associations define how the user identities are mapped. The administrator creates a
source association for the Windows identity, which is a Kerberos principal, and a target association for an
IBM i user profile. These associations enable his Windows identity to be mapped to his IBM i user profile.
John Day uses the appropriate user name and password to log on to his Windows workstation each
morning. After he has logged on, he starts IBM i Access Client Solutions to use his Windows workstation
to access the IBM i system using IBM i Access Client Solutions applications. Because single sign-on is
enabled, the identity mapping process uses his authenticated Windows identity to find the associated
IBM i user profile and transparently authenticates and authorizes him to the IBM i system.
In previous releases of IBM i single sign-on only supported mapping to one local user identity in
Enterprise Identity Mapping (EIM) per system. Currently, single sign-on supports selecting from multiple
local user identity mappings for the same system, using the IP address of the target system to select the
correct local user identity mapping on that system.
IBM i enablement
The IBM i implementation of Enterprise Identity Mapping (EIM) and Kerberos (referred to as network
authentication services) provides a true multi-tier single sign-on environment.
The network authentication service is IBM's implementation of Kerberos and the Generic Security Service
(GSS) APIs. You can use EIM to define associations that will provide a mapping between a Kerberos
principal and an IBM i user profile. You can then use this association to determine which EIM identifier
corresponds to a local IBM i user profile or Kerberos principal. This is one of the benefits of enabling
single sign-on in IBM i on the server.
Single sign-on 7
Enabling single sign-on for your server simplifies the task of managing IBM i user profiles and reduces
the number of sign-ons that a user must perform to access multiple IBM i applications and servers.
Additionally, it reduces the amount of time that is required for password management by each user. Single
sign-on allows each user to remember and use fewer passwords to access applications and servers,
thereby simplifying their IBM i experience.
IBM i client and server applications currently enabled for single sign-on
• IBM i Host Servers is currently used by IBM i Access Client Solutions.
• Telnet server: currently used by PC5250 and IBM WebSphere® Host On-Demand Version 8: Web
Express Logon feature.
• Telnet client
• Open DataBase Connectivity (ODBC): allows single sign-on access to IBM i databases through ODBC.
• Java™ Database Connectivity (JDBC): allows single sign-on access to IBM i databases through ODBC.
• Distributed Relational Database Architecture™ (DRDA): allows single sign-on access to IBM i databases
through ODBC.
• QFileSrv.400
• FTP client and FTP server
ISV enablement
An independent software vendor (ISV) can create applications and programs that can participate in a
single sign-on environment.
As an ISV you know that many of your customers are implementing single sign-on environments to
take advantage of the cost and time benefits that single sign-on provides. You want to ensure that you
design your application products to participate in single sign-on environments so that you can continue to
provide the solutions that your customers want and need.
To enable your applications to participate in an IBM i single sign-on environment, you need to perform the
following tasks:
Enable your IBM i server applications for EIM
One of the foundations of a single sign-on environment is Enterprise Identity Mapping (EIM). EIM is a
mechanism for mapping or associating a person or entity to the appropriate user identities in various
registries throughout the enterprise. Application developers for IBM i use EIM to build applications
that use one user registry for authentication and another for authorization--without requiring the user
to provide another set of credentials. EIM provides APIs for creating and managing these identity
mapping relationships, as well as APIs that applications use to query this information. You can write
applications that use EIM APIs to perform lookup operations for user identities within an enterprise.
Enable your IBM i server and client applications to use a common authentication mechanism
While you are free to choose any common authentication mechanism you want for your application's
single sign-on environment, the IBM i single sign-on environment is based on the network
authentication service (Kerberos) which provides an integrated single sign-on environment with
Windows domains. If you want your applications to participate with the same secure, integrated single
sign-on environment as IBM i, should choose network authentication service as the authentication
mechanism for your applications. The following are examples of the different authentication methods
you can choose for your applications:
Use the Scenario: Enable single sign-on for ISV applications to learn how to use EIM application
programming interfaces (APIs) in conjunction with network authentication service to create
applications that can fully participate in a single sign-on environment. This scenario includes some
ISV code examples, including pseudocode, for example pseudocode and snippets that you can
use to help complete your program.
Situation
You, John Day, are a network administrator for a large wholesale company. Currently you spend much
of your time troubleshooting password and user identity problems, such as forgotten passwords. Your
network is comprised of several IBM i models and a Windows server, where your users are registered
in Microsoft Windows Active Directory. Based on your research, you know that Microsoft Active Directory
uses the Kerberos protocol to authenticate Windows users. You also know that the IBM i platform
provides a single sign-on solution based on an implementation of Kerberos authentication, called network
authentication service, in conjunction with EIM.
You are excited about the benefits of using single sign-on. However, you want to thoroughly understand
single sign-on configuration and usage before you begin using it across your entire enterprise.
Consequently, you decide to configure a test environment first.
After considering the various groups in your company, you decide to create the test environment for the
Order Receiving department. The employees in the Order Receiving department use multiple applications
on one IBM i model to handle incoming customer orders. Consequently, the Order Receiving department
provides an excellent opportunity for you to create a single sign-on test environment that you can use to
better understand how single sign-on works and how to plan a single sign-on implementation across your
enterprise.
Scenario advantages
• Allows you to see some of the benefits of single sign-on on a small scale to better understand how you
can take full advantage of it before you create a large-scale, single sign-on environment.
• Provides you with a better understanding of the planning process you need to use to successfully and to
more quickly implement single sign-on across your entire enterprise.
• Minimizes the learning curve of implementing single sign-on across your enterprise.
Single sign-on 9
Objectives
As the network administrator at MyCo, Inc., you want to create a small single sign-on environment for
testing that includes a small number of users and a single IBM i model. You want to perform thorough
testing to ensure that user identities are correctly mapped within your test environment. Based on this
configuration, you eventually want to expand the test environment to include the other systems and users
in your enterprise.
The objectives of this scenario are as follows:
• The IBM i model, known as System A, must be able to use Kerberos within the MYCO.COM realm to
authenticate the users and services that are participating in this single sign-on test environment. To
enable the system to use Kerberos, System A must be configured for network authentication service.
• The directory server on System A must function as the domain controller for the new EIM domain.
Note: Refer to “Domains” on page 5 to learn how an EIM domain and a Windows domain both fit into
the single sign-on environment.
• One user profile on System A and one Kerberos principal must each be mapped to a single EIM
identifier.
• A Kerberos service principal must be used to authenticate the user to the IBM i Access Client Solutions
applications.
Details
The following figure illustrates the network environment for this scenario.
Single sign-on 11
Configuration steps
Note: You need to thoroughly understand the concepts related to single sign-on which include network
authentication service and Enterprise Identity Mapping (EIM) concepts, before you implement this
scenario. If you are ready to continue with this scenario complete the following steps:
Related tasks
Testing your application
You have completed the development of both client and server specific updates to your Calendar
application, enabling it for an IBM i single sign-on environment. You are now ready to test it.
Configuring single sign-on
To configure a single sign-on environment you must use a compatible authentication method as your
authentication method and Enterprise Identity Mapping (EIM) to create and manage your user profiles
and identity mappings.
Related information
Host name resolution considerations
Enterprise Identity Mapping (EIM)
Have you installed an application that is enabled for single sign- Yes
on on each of the PCs that will participate in the single sign-on
environment?
Note: For this scenario, all of the participating PCs have IBM i
Access Client Solutions (5733-XJ1) installed. See IBM i Access
Client Solutions: Getting Started
You need this information to configure EIM and network authentication service to create a single sign-on
test environment.
Where do you want to configure your EIM domain? On the local directory server
Note: This will configure the directory
server on the same system on which you
are currently configuring EIM.
The Network Authentication Service wizard opens from the EIM Configuration wizard. Use the following
information to complete the Network Authentication Service wizard:
Note: You can launch the Network Authentication Service wizard independently of the EIM Configuration
wizard.
Single sign-on 13
Table 2. Single sign-on configuration planning work sheet for System A (continued)
Configuration planning work sheet for System A Answers
What is the Kerberos server, also known as a key KDC: kdc1.myco.com
distribution center (KDC), for this Kerberos default realm? Port: 88
What is the port on which the Kerberos server listens?
Note: This is the default port for the
Kerberos server.
For which services do you want to create keytab entries? IBM i Kerberos Authentication
• IBM i Kerberos Authentication
• LDAP
• IBM HTTP Server for i
• IBM i NetServer
• IBM i Network File System (NFS) Server
What is the name of the EIM domain that you want to MyCoEimDomain
create?
Do you want to specify a parent DN for the EIM domain? No
Which EIM user do you want System A to use when User type: Distinguished name and
performing EIM operations? This is the system user. password
Note: If you have not configured the directory server before User: cn=administrator
configuring single sign-on, the only distinguished name Password: mycopwd
(DN) you can provide for the system user is the LDAP
Note: Any and all passwords specified in
administrator's DN and password.
this scenario are for example purposes
only. To prevent a compromise to your
system or network security, you should
never use these passwords as part of your
own configuration.
After you complete the EIM Configuration wizard, use the following information to complete the
remaining steps required for configuring single sign-on:
What is the IBM i user profile name for the user? JOHND
What is the name of the EIM identifier that you want to John Day
create?
What kinds of associations do you want to create? Source association: Kerberos principal
jday
Target association: IBM i user profile
JOHND
What is the name of the user registry that contains the MYCO.COM
Kerberos principal for which you are creating the source
association?
What is the name of the user registry that contains the SYSTEMA.MYCO.COM
IBM i user profile for which you are creating the target
association?
What information do you need to supply to test EIM identity Source registry: MYCO.COM
mapping? Source user: jday
Target registry: SYSTEMA.MYCO.COM
Related information
Enterprise Identity Mapping (EIM)
Single sign-on 15
server, you can still use these instructions with only slight differences. These differences are noted in the
appropriate places within the configuration steps.
When you have finished this step, you will have completed the following tasks:
• Created a new EIM domain
• Configured the directory server on System A to be the EIM domain controller
• Configured network authentication service
• Created EIM registry definitions for the System A IBM i registry and the Kerberos registry in the newly
created EIM domain
• Configured System A to participate in the EIM domain
1. In IBM Navigator for i, expand IBM i Management > Security > All Tasks > Enterprise Identity
Mapping > Configuration.
2. Click Configure to start the EIM Configuration wizard.
3. On the Welcome page, select Create and join a new domain. Click Next.
4. On the Specify EIM Domain Location page, select On the local Directory server. Click Next and the
Network Authentication Service wizard is displayed.
Note: The Network Authentication Service wizard only displays when the system determines that
you need to enter additional information to configure network authentication service for the single
sign-on implementation.
5. Complete these tasks to configure network authentication service:
a) On the Configure Network Authentication Service page, select Yes.
Note: This launches the Network Authentication Service wizard. With this wizard, you can
configure several IBM i interfaces and services to participate in a Kerberos realm.
b) On the Specify Realm Information page, enter MYCO.COM in the Default realm field and select
Microsoft Active Directory is used for Kerberos authentication. Click Next.
c) On the Specify KDC Information page, enter kdc1.myco.com in the KDC field and enter 88 in
the Port field. Click Next.
d) On the Specify Password Server Information page, select Yes. Enter kdc1.myco.com in the
Password server field and 464 in the Port field. Click Next.
e) On the Select Keytab Entries page, select IBM i Kerberos Authentication. Click Next.
f) On the Create IBM i Keytab Entry page, enter and confirm a password, and click Next. For
example, systema123. This password will be used when System A is added to the Kerberos
server.
Note: Any and all passwords specified in this scenario are for example purposes only. To prevent a
compromise to your system or network security, you should never use these passwords as part of
your own configuration.
g) Optional: On the Create Batch File page, select Yes, specify the following information, and click
Next:
• Batch file: Add the text systema to the end of the default batch file name. For example, /
QIBM/UserData/OS400/iSeriesNavigator/config/NASConfig_systema.bat.
• Select Include password. This ensures that all passwords associated with the IBM i service
principal are included in the batch file. It is important to note that passwords are displayed
in clear text and can be read by anyone with read access to the batch file. Therefore, it is
recommended that you delete the batch file from the Kerberos server and from the IBM i
immediately after use.
Note: If you do not include the password, you will be prompted for the password when the batch
file is run.
Single sign-on 17
a) In IBM Navigator for i on System A, expand IBM i Management > File Systems > Integrated File
System > Root > QIBM > UserData > OS400 > iSeriesNavigator > config
b) Right-click NASConfig_systema.bat and select Download.
c) Click the Download button on the Confirm Download page.
d) Save the file, this will put it in your browser's download location. Refer to your browser's
documentation for how to customize the download folder location. Usually this is the Downloads
folder.
Note: It is recommended that you now delete the NASConfig_systema.bat file from System A.
Run the batch file on kdc1.myco.com
1. On your Windows server, open the directory where you downloaded the batch file.
2. Find the NASConfig_systema.bat file and double-click the file to run it.
3. After the file runs, verify that the IBM i principal has been added to the Kerberos server by completing
the following:
a. On your Windows server, expand Administrative Tools > Active Directory Users and Computers.
b. Verify the IBM i model has a user account by selecting the appropriate Windows domain and
clicking Users.
Note: This Windows domain should be the same as the default realm name that you specified in the
network authentication service configuration.
c. In the list of users that is displayed, find systema_1_krbsvr400. This is the user account generated
for the IBM i principal name.
d. (Optional) Access the properties on your Active Directory user. From the Delegation tab, select
Trust this user for delegation to any service (Kerberos only).
Note: This optional step enables your system to delegate, or forward, a user's credentials to other
systems. As a result, the IBM i service principal can access services on multiple systems on behalf
of the user. This is useful in a multi-tier network.
Now that you have added the System A service principal to the Kerberos server, you can create a home
directory for John Day.
Single sign-on 19
Note: Any and all passwords specified in this scenario are for example purposes only. To prevent a
compromise to your system or network security, you should never use these passwords as part of
your own configuration.
4. In the Test a mapping dialog box, specify or Browse to select the following information:
• Source registry: MYCO.COM
• Source user: jday
• Target registry: SYSTEMA.MYCO.COM
Note: Click ? for help, if necessary, for more details about what information is needed for each field in
the dialog box.
Click Test, and click Close.
If your EIM mappings are correctly configured, the following results are displayed in the Mapping found
portion of the page:
If you receive messages or errors that indicate problems with your mappings or with communications, see
EIM troubleshooting to help you find solutions to these problems.
Now that you have tested the EIM identify mappings, you can configure IBM i Access Client Solutions
applications to use Kerberos authentication.
Single sign-on 21
tasks presented in the previous scenario which demonstrates how to create a simple single sign-on test
environment.
Situation
You are a network administrator that manages a network and network security for your company,
including the Order Receiving department. You oversee the IT operations for a large number of employees
who take customer orders over the telephone. You also supervise two other network administrators who
help you maintain the network.
The employees in the Order Receiving department use Windows and IBM i and require multiple
passwords for the different applications they use every day. Consequently, you spend a lot of time
managing and troubleshooting problems related to passwords and user identities, such as resetting
forgotten passwords.
As the company's network administrator, you are always looking for ways to improve the business,
starting with the Order Receiving department. You know that most of your employees need the same type
of authority to access the application that they use to query inventory status. It seems redundant and
time consuming for you to maintain individual user profiles and numerous passwords that are required in
this situation. In addition, you know that all of your employees can benefit by using fewer user IDs and
passwords. You want to do these things:
• Simplify the task of password management for the Order Receiving department. Specifically, you want
to efficiently manage user access to the application your employees routinely use for customer orders.
• Decrease the use of multiple user IDs and passwords for the department employees, as well as for the
network administrators. However, you do not want to make the Windows IDs and IBM i user profiles the
same nor do you want to use password caching or synching.
Based on your research, you know that IBM i supports single sign-on, a solution that allows your users
to log on once to access multiple applications and services that normally require them to log on with
multiple user IDs and passwords. Because your users do not need to provide as many user IDs and
passwords to do their jobs, you have fewer password problems to solve for them. Single sign-on seems to
be an ideal solution because it allows you to simplify password management in the following ways:
• For typical users that require the same authority to an application, you can create policy associations.
For example, you want the order clerks in the Order Receiving department to be able to log on once with
their Windows user name and password and then be able to access a new inventory query application
in the manufacturing department without having to be authenticated again. However, you also want
to ensure that the level of authorization that they have when using this application is appropriate. To
attain this goal, you decide to create a policy association that maps the Windows user identities for this
group of users to a single IBM i user profile that has the appropriate level of authority for running the
inventory query application. Because this is a query-only application in which users cannot change data,
you are not as concerned about detailed auditing for this application. Consequently, you feel confidant
that using a policy association in this situation conforms to your security policy.
You create a policy association to map the group of order clerks with similar authority requirements to
a single IBM i user profile with the appropriate level of authority for the inventory query application.
Your users benefit by having one less password to remember and one less logon to perform. As the
administrator, you benefit by having to maintain only one user profile for user access to the application
instead of multiple user profiles for everyone in the group.
• For each of your network administrators who have user profiles with special authorities, such as
*ALLOBJ and *SECADM, you can create identifier associations. For example, you want all of the user
identities for a single network administrator to be precisely and individually mapped to one another
because of the administrator's high level of authority.
Based on your company's security policy, you decide to create identifier associations to map specifically
from each network administrator's Windows identity to his IBM i user profile. You can more easily
monitor and trace the activity of the administrator because of the one-to-one mapping that identifier
associations provide. For example, you can monitor the jobs and objects that run on the system for a
specific user identity. Your network administrator benefits by having one less password to remember
Objectives
In this scenario, you are the administrator at MyCo, Inc. who wants to enable single sign-on for the users
in the Order Receiving department.
The objectives of this scenario are as follows:
• System A and System B must participate in the MYCO.COM realm to authenticate the users and services
that are participating in this single sign-on environment. To enable the systems to use Kerberos, System
A and System B must be configured for network authentication service.
• The IBM Tivoli Directory Server for IBM i (LDAP) on System A must function as the domain controller for
the new EIM domain.
Note: Refer to domains to learn how two different types of domains, an EIM domain and a Windows
domain, fit into the single sign-on environment.
• All user identities in the Kerberos registry must map successfully to a single IBM i user profile with
appropriate authority for user access to the inventory query application.
• Based on your security policy, two administrators, John Day and Sharon Jones, who also have user
identities in the Kerberos registry, must have identifier associations to map these identities to their IBM
i user profiles which have *SECADM special authority. These one-to-one mappings enable you to closely
monitor the jobs and objects that run on the system for these user identities.
• A Kerberos service principal must be used to authenticate the users to the IBM i Access Client Solutions
applications.
Details
The following figure illustrates the network environment for this scenario.
Single sign-on 23
The figure illustrates the following points relevant to this scenario.
EIM domain data defined for the enterprise
• Three registry definition names:
– A registry definition name of MYCO.COM for the Windows server registry. You will define this when
you use the EIM configuration wizard on System A.
– A registry definition name of SYSTEMA.MYCO.COM for the IBM i registry on System A. You will define
this when you use the EIM configuration wizard on System A.
– A registry definition name of SYSTEMB.MYCO.COM for the IBM i registry on System B. You will define
this when you use the EIM configuration wizard on System B.
• Two default registry policy associations:
Note: EIM lookup operation processing assigns the highest priority to identifier associations. Therefore,
when a user identity is defined as a source in both a policy association and an identifier association, only
the identifier association maps that user identity. In this scenario, two network administrators, John
Day and Sharon Jones, both have user identities in the MYCO.COM registry, which is the source of the
default registry policy associations. However, as shown below, these administrators also have identifier
associations defined for their user identities in the MYCO.COM registry. The identifier associations
ensure that their MYCO.COM user identities are not mapped by the policy associations. Instead,
the identifier associations ensure that their user identities in the MYCO.COM registry are individually
mapped to other specific individual user identities.
– One default registry policy association maps all user identities in the Windows server registry called
MYCO.COM, to a single IBM i user profile called SYSUSERA in the SYSTEMA.MYCO.COM registry on
System A. For this scenario, mmiller and ksmith represent two of these user identities.
Single sign-on 25
Administrative PC
• Runs Microsoft Windows operating system.
• Serves as the primary logon system for the administrator.
• Configured to be part of the MYCO.COM realm (Windows domain).
Configuration steps
Note: You need to thoroughly understand the concepts related to single sign-on, which include network
authentication service and Enterprise Identity Mapping (EIM) concepts, before you accomplish this
scenario. If you are ready to continue with this scenario complete the following steps:
Related tasks
Configuring single sign-on
To configure a single sign-on environment you must use a compatible authentication method as your
authentication method and Enterprise Identity Mapping (EIM) to create and manage your user profiles
and identity mappings.
Related information
Host name resolution considerations
Enterprise Identity Mapping (EIM)
EIM associations
Host name resolution
You need this information to configure EIM and network authentication service on System A
Single sign-on 27
Table 4. Single sign-on configuration planning work sheet for System A (continued)
Configuration planning work sheet for System A Answers
Where do you want to configure the EIM domain? On the local directory server
Note: This will configure the directory
server on the same system on which you
are currently configuring EIM.
The Network Authentication Service wizard launches from the EIM Configuration wizard. Use the
following information to complete the Network Authentication Service wizard.
What is the name of the Kerberos default realm to which MYCO.COM
your IBM i model will belong?
Note: A Windows server domain is similar to a Kerberos
realm.
For which services do you want to create keytab entries? IBM i Kerberos Authentication
• IBM i Kerberos Authentication
• LDAP
• IBM HTTP Server for i
• IBM i NetServer
• IBM i Network File System (NFS) Server
What is the name of the EIM domain that you want to MyCoEimDomain
create?
Do you want to specify a parent DN for the EIM domain? No
Which user registries do you want to add to the EIM Local IBM i
domain? --SYSTEMA.MYCO.COM
Kerberos--KDC1.MYCO.COM
Which EIM user do you want System A to use when User type: Distinguished name
performing EIM operations? This is the system user. Distinguished name:
Note: If you have not configured the directory server prior cn=administrator
to configuring single sign-on, the only distinguished name Password: mycopwd
(DN) you can provide for the system user is the LDAP
Note: Any and all passwords specified in
administrator's DN and password.
this scenario are for example purposes
only. To prevent a compromise to your
system or network security, you should
never use these passwords as part of your
own configuration.
You need this information to allow System B to participate in the EIM domain and to configure network
authentication service on System B
Single sign-on 29
Table 5. Single sign-on configuration planning work sheet for System B (continued)
Configuration planning work sheet for System B Answers
The Network Authentication Service wizard launches from the EIM Configuration wizard. Use the
following information to complete the Network Authentication Service wizard:
Note: You can launch the Network Authentication Service wizard independently of the EIM Configuration
wizard.
For which services do you want to create keytab entries? IBM i Kerberos Authentication
• IBM i Kerberos Authentication
• LDAP
• IBM HTTP Server for i
• IBM i NetServer
• IBM i Network File System (NFS) Server
What is the name of the EIM domain that you want to join? MyCoEimDomain
Do you want to specify a parent DN for the EIM domain? No
What is the name of the user registry that you want to add to Local IBM i --SYSTEMB.MYCO.COM
the EIM domain?
Which EIM user do you want System B to use when User type: Distinguished name and
performing EIM operations? This is the system user. password
Note: Earlier in this scenario, you used the EIM Distinguished name:
Configuration wizard to configure the directory server on cn=administrator
System A. In doing so, you created a DN and password Password: mycopwd
for the LDAP administrator. This is currently the only DN
defined for the directory server. Therefore, this is the DN and Note: Any and all passwords specified in
this scenario are for example purposes
password you must supply here.
only. To prevent a compromise to your
system or network security, you should
never use these passwords as part of your
own configuration.
Table 7. Single sign-on configuration planning work sheet - EIM domain data
Identifier name User registry User identity Association Identifier
type description
John Day MYCO.COM jday Source Kerberos
(Windows)
login user
identity
Single sign-on 31
Table 7. Single sign-on configuration planning work sheet - EIM domain data (continued)
Identifier name User registry User identity Association Identifier
type description
John Day SYSTEMA.MYCO.COM JOHND Target IBM i user
profile on
System A
John Day SYSTEMB.MYCO.COM DAYJO Target IBM i user
profile on
System B
Sharon Jones MYCO.COM sjones Source Kerberos
(Windows)
login user
identity
Sharon Jones SYSTEMA.MYCO.COM SHARONJ Target IBM i user
profile on
System A
Sharon Jones SYSTEMB.MYCO.COM JONESSH Target IBM i user
profile on
System B
Table 8. Single sign-on configuration planning work sheet - EIM domain data - policy associations
Policy Source user registry Target user registry User identity Description
association
type
Default MYCO.COM SYSTEMA.MYCO.COM SYSUSERA Maps
registry authenticated
Kerberos user to
appropriate IBM
i user profile
Default MYCO.COM SYSTEMB.MYCO.COM SYSUSERB Maps
registry authenticated
Kerberos user to
appropriate IBM
i user profile
Related information
Enterprise Identity Mapping (EIM)
Single sign-on 33
7. On the Specify Domain page, enter the name of the domain in the Domain field. For example,
MyCoEimDomain.
8. On the Specify Parent DN for Domain page, select No. Click Next.
Note: If the directory server is active, a message is displayed that indicates you need to end and
restart the directory server for the changes to take effect. Click Yes to restart the directory server.
9. On the Registry Information page, select Local IBM i and Kerberos. Click Next. Write down the
registry names. You will need these registry names when you create associations to EIM identifiers.
Note:
• Registry names must be unique to the domain.
• You can enter a specific registry definition name for the user registry if you want to use a specific
registry definition naming plan. However, for this scenario you can accept the default values.
10. On the Specify EIM System User page, select the user the operating system uses when performing
EIM operations on behalf of operating system functions, and click Next.
Note: Because you did not configure the directory server prior to performing the steps in this
scenario, the only distinguished name (DN) that you can choose is the LDAP administrator's DN.
• User type: Distinguished name and password
• Distinguished name: cn=administrator
• Password: mycopwd
Note: Any and all passwords specified in this scenario are for example purposes only. To prevent a
compromise to your system or network security, you should never use these passwords as part of
your own configuration.
11. On the Summary page, confirm the EIM configuration information. Click Finish.
You have completed a basic EIM and network authentication service configuration on System A. The next
step is to configure System B to participate in the EIM domain that you just created
Single sign-on 35
Note: Any and all passwords specified in this scenario are for example purposes only. To prevent a
compromise to your system or network security, you should never use these passwords as part of
your own configuration.
10. On the Summary page, confirm the EIM configuration. Click Finish.
You have now configured System B to participate in the domain and to use network authentication
service.
Single sign-on 37
Ticket cache: FILE:/QIBM/USERDATA/OS400/NETWORKAUTHENTICATION/creds/krbcred
Server: krbtgt/[email protected]
Valid 200X/06/09-12:08:45 to 20XX/11/05-03:08:45
$
Repeat these steps using the service principal name for System B: krbsvr400/
[email protected]
Now that you have tested network authentication service on System A and System B, you can create an
EIM identifier for each of the administrators.
Creating EIM identifiers for two administrators, John Day and Sharon Jones
In this scenario, you create two EIM identifiers, one named John Day and the other named Sharon Jones.
As part of setting up your single sign-on test environment, you need to create EIM identifiers for two of
your administrators so they can both log on to IBM i environments using their Windows user identities.
To create the EIM identifiers, follow these steps:
1. In IBM Navigator for i on System A, expand IBM i Management > Security > All Tasks > Enterprise
Identity Mapping.
2. Click Domain Management.
3. Right-click MyCoEimDomain and select Open.
Note: You might be prompted to connect to the domain controller. In that case, the Connect to EIM
Domain Controller dialog box is displayed. You must connect to the domain before you can perform
actions in it. To connect to the domain controller, provide the following information and click OK:
• User type: Distinguished name
• Distinguished name: cn=administrator
• Password: mycopwd
Note: Any and all passwords specified in this scenario are for example purposes only. To prevent a
compromise to your system or network security, you should never use these passwords as part of
your own configuration.
4. Right-click Identifiers and select New Identifier.
5. On the New EIM Identifier dialog box, enter John Day in the Identifier field.
6. Click OK.
Repeat steps 2 through 6, but enter Sharon Jones in the Identifier field.
Now that you have created an EIM identifier for each of the administrators, you must create identifier
associations that map user identities to the identifiers. First, create the identifier associations for John
Day.
In this scenario, you need to create one source association and two target associations for the John Day
identifier:
• A source association for the jday Kerberos principal, which is the user identity that John Day, the
person, uses to log in to Windows and the network. The source association allows the Kerberos principal
to be mapped to another user identity as defined in a corresponding target association.
To create a target association for John Day's IBM i user profile on System A, follow these steps:
1. On the Associations page, click Add.
2. In the Add Association dialog box, specify or Browse to select the following information, and click OK:
• Registry: SYSTEMA.MYCO.COM
• User: JOHND
• Association type: Target
3. Click OK to close the Add Associations dialog box.
To create a target association for John Day's IBM i user profile on System B, follow these steps:
1. On the Associations page, click Add.
2. In the Add Association dialog box, specify or Browse to select the following information, and click OK:
• Registry: SYSTEMB.MYCO.COM
• User: DAYJO
• Association type: Target
Single sign-on 39
3. Click OK to close the Add Associations dialog box.
4. Click OK to close the Properties dialog box.
Now that you have created the identifier associations that map John Day's user identities to his EIM
identifier, you can create similar associations for Sharon Jones.
Single sign-on 41
1. On the Registry page, click Add.
2. In the Add Default Registry Policy Association dialog box, specify or Browse to select the following
information, and click OK:
• Source registry: MYCO.COM
• Target registry: SYSTEMA.MYCO.COM
• Target user: SYSUSERA
3. Click OK to close the Mapping Policy dialog box.
Follow these steps to create the default registry policy association for the users to map to the
SYSUSERB user profile on System B:
4. On the Registry page, click Add.
5. In the Add Default Registry Policy Association dialog box, specify or Browse to select the following
information, and click OK:
• Source registry: MYCO.COM
• Target registry: SYSTEMB.MYCO.COM
• Target user: SYSUSERB
6. Click OK to close the Mapping Policy dialog box.
Now that you have created the default registry policy associations, you can enable the registries to
participate in lookup operations and to use the policy associations.
Single sign-on 43
For these fields See these results
Origin EIM Identifier: John Day
6. Click Close.
Repeat these steps but select SYTEMB.MYCO.COM for the Target registry field. Results will display in
the Mapping found portion of the page, as follows:
Single sign-on 45
For these fields See these results
Target user SYSUSERB
Origin Registry policy association
6. Click Close.
If you receive messages or errors that indicate problems with your mappings or with communications, see
Troubleshoot EIM to help you find solutions to these problems.
Now that you have tested the EIM identity mappings, you can configure IBM i Access for Windows
applications to use Kerberos authentication.
Situation
You are the lead application developer for an independent software vendor (ISV), and are responsible
for overseeing the applications that your company develops and delivers to IBM i Access Client Solutions
customers. You know that IBM i Access Client Solutions provides your customers with the capability
Single sign-on 47
of creating and participating in a single sign-on environment. You want your applications to leverage
these single sign-on capabilities because you feel it will help sell your product. You decide to market an
application called Calendar to IBM i Access Client Solutions customers that use network authentication
service and Enterprise Identity Mapping (EIM) to create their single sign-on environment. The Calendar
application allows users to view and manage their workday schedule. Enabling the Calendar application
for single sign-on requires you to include server specific code within your application which enables it
to participate within a single sign-on environment. You have previous experience creating applications
that call EIM APIs, but this will be your first time working with an application that also calls network
authentication service APIs.
Note: It is also possible to develop applications for a single sign-on environment that use a different
authentication method. For example, you can insert the necessary code for authenticating with digital
certificates, or for binding the directory server, instead of inserting the necessary code for authenticating
with network authentication service.
Objectives
You want to be able to market your Calendar application to IBM i Access Client Solutions customers who
are interested in applications that are capable of participating in a single sign-on environment. You want
to enable the server side of the Calendar application to participate in a single sign-on environment. You
have the following objectives, as you complete this scenario:
• You want to change the server specific part of an existing Calendar application or develop a new
Calendar application which participates in a single sign-on environment that uses EIM and network
authentication service.
• You want to create a single sign-on environment in which you can test your application.
• You want to test your Calendar application and ensure that it successfully participates in a single
sign-on environment.
Configuration steps
Related information
Programming
Generic Security Service API
IBM® Java Generic Security Service (JGSS)
Single sign-on 49
See the ISV code examples for example pseudocode and snippets that you can use to help complete the
server specific part of your program. When you have added the necessary client and server specific code
to your Calendar application, you can create a single sign-on test environment to test it.
//---------------------------------------------------------------------
// EIM assumptions:
// On the IBM i where this program is running the EIM configuration
// information has been set. The information used by this program
// is:
// - ldapURL
// - local registry
// EIM ldap lookup connection
// - The ldap connection information needed for doing the mapping
// lookups in this program can be stored in a validation list
// or other user secure space. Here we will just hard code
// pretend values.
// - This connection will only be used for a lookup operation so
// the ldap user only needs EIM mapping lookup authroity.
// All EIM data (Identifiers and associations) has been added.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//
// Function: l_eimError
// Purpose: EIM error has occurred. This function will print out the
// EIM error message.
//
//----------------------------------------------------------------------
void l_eimError(char * function, EimRC * err)
{
char * msg = NULL;
printf("EIM ERROR for function = %s.\n", function);
msg = eimErr2String(err);
printf(" %s\n",msg);
free(msg);
}
//----------------------------------------------------------------------
//
// Function: l_eimConnect
// Purpose: Get an EIM handle and connect to the ldap server.
//
//----------------------------------------------------------------------
int l_eimConnect(EimHandle * handle)
{
int rc = 0;
char eimerr[150];
EimRC *err = (EimRC *)&eimerr;
Single sign-on 51
EimConnectInfo con;
//------------------------------------------------------------------
// Create handle. We will pass NULL for the URL indicating that we
// will use the information that was configured for the system.
//------------------------------------------------------------------
eimCreateHandle(handle,
NULL,
err);
//------------------------------------------------------------------
// Connect
//------------------------------------------------------------------
// The ldap user id and password might be stored in a validation
// list or other user secure space. Here we will just hard code
// pretend values.
// You can also choose to use Kerberos authentication when
// connecting to ldap. You will first need to verify your ldap
// server is set up to accept kerberos authentication.
//------------------------------------------------------------------
// This connection will only be used for a lookup operation so the
// ldap user only needs EIM mapping lookup authroity.
//------------------------------------------------------------------
con.type = EIM_SIMPLE;
con.creds.simpleCreds.protect = EIM_PROTECT_NO;
con.creds.simpleCreds.bindDn = LDAP_BINDDN;
con.creds.simpleCreds.bindPw = LDAP_BINDPW;
con.ssl = NULL;
eimConnect(handle,
con,
err);
return 0;
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//
// Function: getIBMiUser
// Purpose: Get IBM i user associated with the kerberos user and exchange
// to the user.
//
//----------------------------------------------------------------------
int getIBMiUser(EimHandle * handle,
char * IBMiUser,
gss_buffer_desc * client_name)
{
char * principal;
char * realm;
char * atsign;
//------------------------------------------------------------------
//
// Get principal and realm from the kerberos client_name.
//
//------------------------------------------------------------------
// client_name.value contains string of principal@realm. Get
// pointer to each piece.
//------------------------------------------------------------------
principal = client_name->value;
atsign = strchr(principal, '@');
*atsign = 0x00; // NULL end the principal
realm = atsign + 1; // Advance pointer to the realm
//------------------------------------------------------------------
//
// Call EIM to get the target user associated with the kerberos
// source user. This sample application assumes that the
// kerberos realm name is also the name of the EIM registry
// defining this realm.
//
//------------------------------------------------------------------
listPtr = (EimList *)listBuff;
for (i = 0; i < 2; i++)
{
if (0 != (rc =
eimGetTargetFromSource(handle,
realm,
if (listPtr->bytesAvailable == listPtr->bytesReturned)
break;
else
{
listSize = listPtr->bytesAvailable;
freeStorage = malloc(listSize);
listPtr = (EimList *)freeStorage;
}
}
return 0;
/********************************************************************/
/* Function Name: get_kerberos_credentials_for_server */
/* */
/* Descriptive Name: Basically this function finds the keytab entry */
/* for this server. It will use this to validate */
/* the tokens received. */
/* */
/* Input: char * service_name - the service name. */
/* gss_buffer_t msg_buf - the input message */
/* Output: */
/* gss_cred_id_t *server_creds - The output credential */
/* */
/* Exit Normal: return value == 0 */
/* Exit Error: -1, error was encountered, */
/********************************************************************/
int get_kerberos_credentials_for_server (
char * service_name, /* name of service principal*/
gss_cred_id_t * server_creds) /* credential acquired */
{
gss_buffer_desc name_buf; /* buffer for import name */
gss_name_t server_name; /* gss service name */
OM_uint32 maj_stat, /* GSS status code */
min_stat; /* Mechanism kerberos status */
return 0;
}
/********************************************************************/
Single sign-on 53
/* Function Name: do_kerberos_authentication() */
/* Purpose: Any valid client request is accepted. If a context */
/* is established, its handle is returned in context and */
/* the client name is returned. */
/* */
/* Exit Normal: return value == 0 */
/* Exit Error: -1, error was encountered, */
/********************************************************************/
int do_kerberos_authentication (
int s, /* socket connection */
gss_cred_id_t server_creds, /* credentials for the server */
gss_ctx_id_t * context, /* GSS context */
gss_buffer_t client_name) /* kerberos principal */
{
gss_buffer_desc send_tok, /* token to send to client */
recv_tok; /* token received from client */
gss_name_t client; /* client principal */
OM_uint32 maj_stat, /* GSS status code */
min_stat; /* Mechanism (kerberos) status*/
msgDesc_t msgSend, /* Message buffer to send */
msgRecv; /* Message buffer received */
gss_OID doid;
do {
/* Receive the message from the client */
memset(&msgRecv, 0x00, sizeof(msgRecv));
if (0 != recvAmessage(s, &msgRecv))
return -1;
recv_tok.length = msgRecv.dataLength;
recv_tok.value = msgRecv.buffer;
return 0;
}
/********************************************************************/
/* */
/* Function Name: getTestPort() */
/* */
/* Descriptive Name: get the port on which the server is listening */
/* */
/* Input: char * service - the service name. If null, looks */
/* for kerb-test-server. */
/* */
/* Output: none */
/* */
/* Exit Normal: return value == port number */
/* */
return ntohl(retPort);
} /* end getPort */
/********************************************************************/
/* */
/* Function Name: getListeningSocket() */
/* */
/* Descriptive Name: get a listening socket created and return it. */
/* */
/* Input: none. */
/* */
/* Output: listening socket created. */
/* */
/* Exit Normal: return value == listening socket. */
/* */
/* Exit Error: -1, error was encountered. */
/* */
/* NOTE: Error checking removed */
/* */
/********************************************************************/
CLINKAGE int getListeningSocket(void)
{
int rc, sd, option;
struct sockaddr_in sin;
sd = socket(AF_INET, SOCK_STREAM, 0)
option = 1;
listen(sd, SOMAXCONN);
return sd;
} /* end getListeningSocket() */
/********************************************************************/
/* */
/* Function Name: getServerSocket() */
/* */
/* Descriptive Name: get a server socket that is connected to a */
/* client. This routine blocks waiting for */
/* the client. */
/* */
/* Input: int lsd - listening socket. */
/* */
/* Output: server socket created. */
/* */
/* Exit Normal: return value == server socket. */
/* */
Single sign-on 55
/* Exit Error: -1, error was encountered. */
/* */
/* NOTE: Error checking removed */
/* */
/* */
/********************************************************************/
CLINKAGE int getServerSocket(int lsd)
{
return accept(lsd, NULL, 0);
} /* end getServerSocket() */
/********************************************************************/
/* */
/* Function Name: main */
/* */
/* Descriptive Name: Driver for the server program which performs */
/* kerberos authentication and EIM mapping. */
/* */
/* Input: char* service_name - name of service requested */
/* */
/* Exit Normal: 0 = success */
/* */
/* Exit Error: -1, error was encountered. */
/* */
/* NOTE: Error checking removed */
/* */
/* */
/********************************************************************/
int main(int argc, char **argv)
{
int ssd, /* server socket */
lsd; /* listening socket */
char *service_name; /* name of service (input) */
gss_cred_id_t server_creds; /* server credentials to acquire */
gss_ctx_id_t context; /* GSS context */
OM_uint32 maj_stat, /* GSS status code */
min_stat; /* Mechanism (kerberos) status */
gss_buffer_desc client_name; /* Client principal establishing
context. */
char IBMiUser[10];
char save_handle[SY_PH_MAX_PRFHDL_LEN]; // *CURRENT profile handle
char client_handle[SY_PH_MAX_PRFHDL_LEN];// Swap to profile handle
EimHandle eimHandle;
Qus_EC_t errorcode;
memset(errorcode, 0x00, 256);
errorcode->Bytes_Provided = 256;
service_name = argv[1];
/*------------------------------------------------------------------
// Kerberos setup
// Acquire credentials for the service
//----------------------------------------------------------------*/
get_kerberos_credentials_for_server(service_name, &server_creds);
/*------------------------------------------------------------------
// get a listening socket
//----------------------------------------------------------------*/
lsd = getListeningSocket();
/*------------------------------------------------------------------
// EIM setup
// Connect to eim
// ----------------------------------------------------------------*/
l_eimConnect(&eimHandle);
/*-------------------------------------------------------------------
// Save a copy of the current user so we can swap back to it
// after each request
// ----------------------------------------------------------------*/
QsyGetProfileHandleNoPwd(save_handle,
"*CURRENT ",
"*NOPWD ",
&errorcode);
/*------------------------------------------------------------------
// Loop waiting for requests on the socket
//----------------------------------------------------------------*/
do { /* loop until the application or the system is ended */
/* Save the profile handle of the current user */
/* -----------------------------------------------------------------
// Establish context with the client and get the client name.
//------------------------------------------------------------------
// The client name contains the kerberos principal and realm. In
// EIM these equate to the source user and source registry.
//--------------------------------------------------------------- */
do_kerberos_authentication(ssd,
server_creds,
&context,
&client_name);
/*------------------------------------------------------------------
// Perform eim mapping lookup operation to get the associated
// IBM i user.
//--------------------------------------------------------------- */
getIBMiUser(&eimHandle,
IBMiUser,
&client_name);
/* -----------------------------------------------------------------
// Swap to the user returned from EIM lookup
// ---------------------------------------------------------------- */
QsyGetProfileHandleNoPwd(client_handle,
client_name,
"*NOPWDCHK ",
&errorcode);
QsySetToProfileHandle(client_handle, &errorcode);
/* -----------------------------------------------------------------
// do the real work of the application here as the application is
// now running under an appropriate user profile
// ---------------------------------------------------------------- */
// Call or code application specific behavior here.
/* -----------------------------------------------------------------
// reset the process to run under the original user profile
// ---------------------------------------------------------------- */
QsySetToProfileHandle(save_handle, &errorcode);
} while (1)
eimDestroy_handle(&eimHandle);
Single sign-on 57
To configure a single sign-on environment you must use a compatible authentication method as your
authentication method and Enterprise Identity Mapping (EIM) to create and manage your user profiles
and identity mappings.
Related information
Planning Enterprise Identity Mapping for IBM i
For information about acquiring the latest service pack, see, IBM i Support web page .
• IBM i Host Servers (5770-SS1 Option 12) is installed.
• Qshell Interpreter (5770-SS1 Option 30) is installed.
• TCP/IP and basic system security are configured.
• If you intend to use the Synchronize Functions wizard, configure the systems to use Secure Sockets
Layer (SSL) to protect the transmission of sensitive configuration information, such as passwords.TCP/IP
and basic system security are configured.
Client PC requirements
To create a successful single sign-on environment, ensure that all these requirements are met:
• Microsoft Windows is used.
• IBM i Access Client Solutions (5733-XJ1) is installed.
• TCP/IP is configured.
If you intend to use the Synchronize Functions wizard in System i Navigator to propagate an existing
single sign-on configuration across multiple systems or if you intend to configure Management Central
servers for single sign-on using System i Navigator, ensure all these requirements are met:
• Microsoft Windows operating system is used.
• IBM i Access for Windows, 5.4, or later, is installed.
– Network component of System i Navigator is installed on PC that administers single sign-on.
– Security component of System i Navigator is installed on PC that administers single sign-on.
• Latest IBM i Access for Windows service pack is installed.
Single sign-on 59
Table 9. Single sign-on prerequisite work sheet (continued)
Prerequisite work sheet Answers
If you intend to use the Synchronize Functions wizard in
System i Navigator to propagate an existing single sign-on
configuration across multiple systems or if you intend to
configure Management Central servers for single sign-on using
System i Navigator :
• Is System i Navigator installed on the administrator's PC?
• Is the Security subcomponent of System i Navigator installed
on the administrator's PC?
• Is the Network subcomponent of System i Navigator installed
on the administrator's PC?
• Have you installed the latest IBM i Access for Windows
service pack? For the latest service pack, see, IBM i Support
web page .
Single sign-on 61
Table 10. Single sign-on configuration planning work sheet (continued)
Configuration planning work sheet Answers
What is the name of the EIM domain that you want to
create?
Do you want to specify a parent DN for the EIM domain?
Which user registries do you want to add to the EIM
domain?
Which EIM user do you want System A to use when
performing EIM operations? This is the system user.
After you complete the EIM Configuration wizard, use the following information to complete the
remaining steps required for configuring single sign-on:
What is the IBM i user profile name for the user?
What is the name of the EIM identifier that you want to
create?
What kinds of associations do you want to create?
What is the name of the user registry that contains the
Kerberos principal for which you are creating the source
association?
What is the name of the user registry that contains the
IBM i user profile for which you are creating the target
association?
What information do you need to supply to test EIM identity
mapping?
Related tasks
Configuring single sign-on
To configure a single sign-on environment you must use a compatible authentication method as your
authentication method and Enterprise Identity Mapping (EIM) to create and manage your user profiles
and identity mappings.
Single sign-on 63
In this scenario, you want to configure network authentication service and EIM to create a basic single
sign-on test environment. Use this scenario to gain a basic understanding of what configuring a single
sign-on environment involves on a small scale before implementing single sign-on across an entire
enterprise.
Scenario: Enabling single sign-on for IBM i
View this scenario to learn how to configure network authentication service and EIM to create a single
sign-on environment across multiple systems in an enterprise. This scenario expands on the concepts and
tasks presented in the previous scenario which demonstrates how to create a simple single sign-on test
environment.
Single sign-on planning worksheets
Complete these worksheets to ensure that you have met all of the prerequisites for single sign-on and
that you have considered all of the aspects of your particular system and its security requirements.
Related tasks
Planning for single sign-on
The single sign-on planning process identifies the software and hardware prerequisites required to
implement single sign-on in your enterprise.
Troubleshooting single sign-on
Use the following troubleshooting methods to solve some of the basic problems you might experience
while configuring and using a single sign-on environment.
Related information
Configuring network authentication service
Configuring Enterprise Identity Mapping
You are unable to connect to IBM i • This might be due to host resolution problems. Verify that the PC
systems within your single sign-on and your IBM i resolve to the same host name. Verify your host
environment. name resolution configurations, including your DNS server.
• This might be due to NAS configuration problems. See the
Troubleshoot network authentication service information in the
IBM i Information Center.
The NSLOOKUP utility fails to The NSLOOKUP utility uses the currently configured DNS to resolve
resolve a host name when given IP addresses from host names, as well as host names from IP
an IP address during an attempt addresses. If a host name cannot be resolved from an IP address,
to confirm that the host resolution the most likely cause is a missing PTR record in DNS. Have your
is consistent between your IBM i DNS administrator add a PTR record for this IP address.
system and a client PC.
Single sign-on 65
Table 11. Troubleshooting table (continued)
Symptoms Possible solutions
EIM mappings are not working • The domain controller is inactive. Activate the domain controller.
as expected. In some instances,
• The EIM configuration is incorrect on the systems that you are
you are unable to sign into your
trying to use Kerberos authentication with or get mappings for.
system with IBM i Access Client
Verify your EIM configuration. On the system you are trying to
Solutions when using Kerberos
authenticate with, expand Network > All Tasks > Enterprise
authentication.
Identity Mapping. Click Configuration. Right-click the Domain
Controller with which you want to work and select Properties.
Verify the following:
– Domain page:
- The domain controller name and port numbers are correct.
- Click Verify Configuration to verify that the domain
controller is active.
- The local registry name is specified correctly.
- The Kerberos registry name is specified correctly.
- Verify that Enable EIM operations for this system is
selected.
– System user page:
- The specified user has sufficient EIM access control to
perform a mapping lookup, and the password is valid for the
user. See the online help to learn more about the different
types of user credentials.
Note: Whenever passwords are updated in the directory
server, they must also be updated in the system
configuration.
- Click Verify Connection to confirm that the user information
specified is correct.
• The EIM domain configuration is incorrect:
Note: You can test EIM mapping to help verify that the
associations for your EIM domain are properly configured.
– A target or source association for an EIM identifier is not set
up correctly. For example, there is no source association for
the Kerberos principal (or Windows user) or it is incorrect.
Or, the target association specifies an incorrect user identity.
Display all identifier associations for an EIM identifier to verify
associations for a specific identifier.
– A policy association is not set up correctly. Display all
policy associations for a domain to verify source and target
information for all policy associations defined in the domain.
– Mapping lookups are returning more than one target identity,
indicating that ambiguous mappings are configured. Test EIM
mappings to identify which mappings are incorrect.
– The registry definition and user identities do not match
because of case sensitivity. You can delete and re-create
the registry, or delete and re-create the association with the
proper case.
A keytab entry is not found • This can be due to a host resolution problem on the IBM i. If
when you perform a keytab you are using a host table, perform the Configure TCP/IP CFGTCP
list. command, option 10 (Work with TCP/IP host table entries) and
verify that the primary host name is listed first for the IP address
of the server.
• Verify your host name resolution configurations, including your
DNS server.
Users are unable to connect to Users might be unable to connect to systems if the EIM registry
systems. definition for the Kerberos registry was inappropriately defined as
case sensitive. Delete and re-create the Kerberos registry.
Note: You will lose any associations that have been defined for that
registry and will have to re-create them.
User receives a message The password for the service in the KDC does not match the
indicating an incorrect password for the service in the keytab. Update the keytab entry
password when verifying the by using the keytab add command, and update the password for
network authentication service the service on the KDC.
configuration.
User receives the following Verify that a home directory (/home/<user profile>) exists
message: Unable to for the user that is performing the kinit.
obtain name of default
credentials cache.
User receives the following Update the network authentication service configuration to use TCP
message: Response too large as the data communications protocol:
for datagram.
1. Using IBM Navigator for i, for the system that issued
the message, expand Security > All Tasks > Network
Authentication Service.
2. Click Properties.
3. On the General page, select Use TCP and click OK.
General problems
Single sign-on 67
Table 11. Troubleshooting table (continued)
Symptoms Possible solutions
You receive error message • Use the help associated with the text to resolve the problem.
CWBSY10XX when attempting
• Use the System Access detail trace feature to determine if the
single sign-on.
appropriate Kerberos ticket is retrieved.
• Download the Microsoft kerbtray utility to verify that the user has
Kerberos credentials.
• If single sign-on is failing, check the QZSOSIGN jobs in the
QUSRWRK subsystem. Search through the jobs for a CPD3E3F
message. If you find the CPD3E3F message, use the recovery
information provided within the message. The diagnostic
message contains both major and minor status codes to indicate
where the problem occurred. The most common errors are
documented in the message along with the recovery.
• If PC5250 is failing, check the following:
– Check the QTVDEVICE jobs for the CPD3E3F message.
– Check the QRMTSIGN system value and verify that it is set to
*VERIFY or *SAMEPRF.
Related information
RFC 1713: Tools for DNS debugging
Troubleshoot EIM.
Configuring network authentication service
Host name resolution considerations
Testing EIM mappings
IBM Redbooks
The IBM System i Security Guide for IBM i5/OS Version 5 Release 4 IBM Redbooks publication
provides a chapter on authentication using Single sign-on.
Other information
• Enterprise Identity Mapping (EIM)
• Network authentication services
• IBM Tivoli Directory Server for IBM i
• Digital Certificate Manager
Single sign-on 69
70 IBM i: Single sign-on
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available in
your area. Any reference to an IBM product, program, or service is not intended to state or imply that
only that IBM product, program, or service may be used. Any functionally equivalent product, program, or
service that does not infringe any IBM intellectual property right may be used instead. However, it is the
user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents. You can
send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of
the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including this
one) and (ii) the mutual use of the information which has been exchanged, should contact:
IBM Corporation
Software Interoperability Coordinator, Department YBWA
3605 Highway 52 N
Rochester, MN 55901
U.S.A.
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be
trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at
"Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.
Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
72 Notices
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the
United States, other countries, or both.
Java and all Java-based trademarks and logos are trademarks of Oracle, Inc. in the United States, other
countries, or both.
Other product and service names might be trademarks of IBM or other companies.
Notices 73
74 IBM i: Single sign-on
IBM®