Difference between revisions of "CTP Authentication Using OpenAM"

From MircWiki
Jump to navigation Jump to search
(Created page with "UNDER CONSTRUCTION This article describes how to configure CTP to use an OpenAM server to authenticate users. The intended audience for this article is CTP administrators. The ...")
 
Line 18: Line 18:
 
A user establishes a Single-Sign-On (SSO) session with the OpenAM server by accessing the server's login page. In CTP installations (including ISN), the login page URL includes the URL of the target system to which the user wishes to be authenticated (CTP or the Edge Server). For example, to be authenticated and then redirected to a CTP server, the login URL might be:
 
A user establishes a Single-Sign-On (SSO) session with the OpenAM server by accessing the server's login page. In CTP installations (including ISN), the login page URL includes the URL of the target system to which the user wishes to be authenticated (CTP or the Edge Server). For example, to be authenticated and then redirected to a CTP server, the login URL might be:
  
:<b><tt>http://myOpenAMServer.myUniversity.edu:80/openam/UI/Login?goto=http://ctp/myUniversity.edu:1080</tt></b>
+
:<b><tt>http://myOpenAMServer.myUniversity.edu:80/openam/UI/Login?goto=http://CTP.myUniversity.edu:1080</tt></b>
  
 
The OpenAM server returns a page containing a form allowing the user to enter the username and password.
 
The OpenAM server returns a page containing a form allowing the user to enter the username and password.

Revision as of 14:46, 5 March 2014

UNDER CONSTRUCTION

This article describes how to configure CTP to use an OpenAM server to authenticate users. The intended audience for this article is CTP administrators.

The CTP OpenAM authentication mechanism uses an external OpenAM server to authenticate users' sessions and to obtain users' roles. This mechanism is different from the LDAP mechanism in that no user information is stored locally.

The OpenAM authentication mechanism is configured in the OpenAM child element of the Server element in the CTP configuration file (config.xml). The Server element is described in the top-level CTP article. To configure CTP to use OpenAM authentication, The usersClassName attribute of the Server element must be set to org.rsna.server.UsersOpenAMImpl, and the OpenAM child element must be appended to the Server element. The OpenAM child element is shown below:

        <OpenAM 
            openAMURL="http://myOpenAMServer.myUniversity.edu:80" />

where:

  • openAMURL specifies the full URL of the OpenAM server, including the protocol and the port.

A brief description of the authentication mechanism may be helpful in testing.

A user establishes a Single-Sign-On (SSO) session with the OpenAM server by accessing the server's login page. In CTP installations (including ISN), the login page URL includes the URL of the target system to which the user wishes to be authenticated (CTP or the Edge Server). For example, to be authenticated and then redirected to a CTP server, the login URL might be:

http://myOpenAMServer.myUniversity.edu:80/openam/UI/Login?goto=http://CTP.myUniversity.edu:1080

The OpenAM server returns a page containing a form allowing the user to enter the username and password.

When the Log In button is clicked on the page, the browser posts the form to the OpenAM server, which authenticates the user and, if the credentials are accepted, redirects the browser to the URL specified in the goto query parameter. The redirect response sent by the OpenAM server to the browser includes a Set-Cookie header setting a domain cookie for the SSO session. The browser then provides that cookie in all subsequent requests in that domain.

Note: All testing has been done with the OpenAM server and the destination CTP server in the same domain. It's not clear whether the SSO session cookie is set on the domain of the destination URL or on the domain of the OpenAM server.

When the destination system receives the HTTP connection from the browser, it sees the session cookie and validates it with the OpenAM server. With a valid cookie, the system can obtain the user's attributes from the OpenAM server.

For efficiency, CTP maintains an internal session table. When a connection is received, it gets the SSO cookie and validates it against its internal table. If the session is present (and matches certain other criteria designed to prevent poaching), the connection is considered to be authenticated, and the connection is assigned to the user associated with the session. If the SSO cookie does not correspond to a session in the internal session table, CTP validates the cookie with the OpenAM server. If the OpenAM server accepts the cookie, CTP creates an internal session for the user and assigns the user the username and roles that it obtains from the attributes for the session provided by the OpenAM server.

CTP gets the user's username from the uid attribute and the roles from the role attribute.

OpenAMTest

There is a simple test program that may help in testing a connection to an OpenAM server. The program is available at http://mirc.rsna.org/download/OpenAMTest.jar. Run the program on any computer that has Java on it and that can communicate with the OpenAM server. (As noted above, the computer should be in the same domain as the OpenAM server.) It displays a window like this:


Error creating thumbnail: Unable to save thumbnail to destination


The default values are ones that were used at the Mallinckrodt Institute of Radiology during ISN testing, so they won’t be useful in your case.

  1. Set the OpenAM Server field to point to your OpenAM server.
  2. Set the Test Server to point to an unused port on your test computer. The program will open a server on this port to receive the connections from the browser after it has been redirected by the OpenAM server.
  3. Click the SSO Cookie button. The program will contact the OpenAM server to get the name of the SSO cookie and display it.
  4. Click the Login button. The program will launch your browser and go to the OpenAM login page.
  5. Enter the credentials of a user and click the Log In button on the page. The program will display any connections it subsequently receives from the browser. In most cases there will be two connections. The first will be the browser's attempt to access the resource in the redirect. The second, if present, will be a request to obtain the favicon.ico resource, which the browser uses to display an icon in a favorites list. The key thing to note is whether there is an SSO session cookie in the request.
  6. Click the Validate button. The program will validate the cookie against the OpenAM server and display the result. If the session is valid, the result should be true.
  7. Click the Attributes button. The program will obtain the attributes of the session from the OpenAM server and display them in two lists. The first shows exactly what was obtained from the OpenAM server; the second shows how the attributes were parsed. Check that there is a uid attribute and a role attribute. The latter might be multi-valued, with one value for each role assigned to the user.