Chapter 13. Java Open Single Sign-on
Java Open Single Sign-on (JOSSO) is an open-source single sign-on solution based on Java EE. It allows multiple web servers or web applications to authenticate users with a credential store. Detailed information about JOSSO can bhttp://docbuilder.usersys.redhat.com/16459/remarks/#Configure_Salesforce_Domaine found at http://www.josso.org.
JOSSO integration with the portal requires an Apache Tomcat server instance to host JOSSO. The portal communicates with the JOSSO server through a SSO plug-in.
Setting up the integration consists of two steps:
- Setting up the JOSSO server
- Setting up the portal to use the JOSSO server
These two steps differ depending on the chosen version of JOSSO, as described in Section 13.2, “Java Open Single Sign-on Version 1.8” and Section 13.3, “Java Open Single Sign-on Version 2.2”. After completing the procedures described in either section, all links redirecting to user authentication pages will redirect to the JOSSO centralized authentication form.
13.1. Authenticating Java Open Single Sign-on
The login workflow for JOSSO is quite similar to that used for CAS authentication.
When a user clicks to sign into a portal, they are redirected to the JOSSO login screen, where they supply the appropriate credentials. They are then redirected (with access authorization) back to the portal.
The
JOSSOAgent component performs a validation of the authorization ticket with the JOSSO server via a back channel after the InitiateLoginFilter has delegated the josso_assertion_id request to it. The JOSSO agent and JOSSO server communicate via web services.
After a successful validation, the user identity is successfully established and the user is logged into the requested Portal.
On logout,
JOSSOLogoutFilter performs a logout on both the Portal and the JOSSO server (similar to the process for CAS).
While the authentication plug-in (which is able to send REST requests to the portal, receive the response, and authenticate the user on the JOSSO side) is supported, this support is only for JOSSO 1.8 (not JOSSO 2.2 as at this release).
In this section, it is assumed that the portal is running on JBoss Enterprise Application Platform 6 using
localhost:8080 and that the JOSSO server is running on Tomcat, using localhost:8888.
Note
There are differences between various JOSSO minor versions (especially between JOSSO versions 1.8.1 and 1.8.2). Instructions are slightly different between various versions. This is described in procedures as required.
13.2. Java Open Single Sign-on Version 1.8
JOSSO can be downloaded from http://sourceforge.net/projects/josso/files/. Use any 1.8.z version in a package that embeds Apache Tomcat. Once downloaded, extract the package into what will be called JOSSO_HOME in this example.
13.2.1. Setting up Java Open Single Sign-on Server
This section describes how to set up the JOSSO server to authenticate against the portal using the REST authentication plug-in.
Note
In this example, the JOSSO server is installed on Tomcat.
Procedure 13.1. Java Open Single Sign-on setup
- Copy the contents of the
JPP_DIST/gatein-sso/josso/josso-2.2/plugin/directory into the JOSSO_HOME directory. Among the files that will be copied, the following ones are the most important:Note
It is recommended to use the SSO authentication plug-in with JOSSO.JOSSO_HOME/lib/josso-gateway-config.xmlThe original file is being replaced. Create a backup of the file before adding the new file.JOSSO_HOME/lib/josso-gateway-gatein-stores.xmlThis file is not present in the original JOSSO_HOME download.JOSSO_HOME/webapps/josso/WEB-INF/classes/gatein.propertiesThis file is not present in the original JOSSO_HOME download. You have to edit the file and change the host and port to match the portal instance. The values are used by the authentication plug-in when sending REST requests over HTTP.
- Edit
JOSSO_HOME/conf/server.xmland replace the8080port to8888to change the default Tomcat port and avoid a conflict with the default portal port (for testing purposes).Port Conflicts
If the portal is running on the same machine as Tomcat, other ports need to be changed in addition to8080to avoid port conflicts. They can be changed to any free port. For example, you can change the admin port from8005to8805, and AJP port from8009to8809. - Tomcat allows access to
http://localhost:8888/josso/signon/login.do. If you are using the SSO Authentication plug-in, the login will not be available as the portal platform must be configured to use the instance.
13.2.2. Setting up Java Open Single Sign-on Client
To enable JOSSO on the client side you have to modify the configuration properties file
JPP_HOME/standalone/configuration/gatein/configuration.properties.
- Set SSO propertiesSet the values of
#SSOas per the SSO configuration properties:Example 13.1. SSO configuration.properties
#SSO gatein.sso.enabled=true gatein.sso.callback.enabled=${gatein.sso.enabled} gatein.sso.login.module.enabled=${gatein.sso.enabled} gatein.sso.login.module.class=org.gatein.sso.agent.login.SSOLoginModule gatein.sso.josso.agent.config.file=sso/josso/1.8/josso-agent-config.xml gatein.sso.josso.properties.file=file:${jboss.home.dir}/standalone/configuration/gatein/configuration.properties gatein.sso.josso.host=localhost:8888 gatein.sso.josso.base.url=http://${gatein.sso.josso.host}/josso/signon gatein.sso.server.url=${gatein.sso.josso.base.url}/login.do gatein.sso.portal.url=http://localhost:8080 gatein.sso.filter.logout.class=org.gatein.sso.agent.filter.JOSSOLogoutFilter gatein.sso.filter.logout.url=${gatein.sso.josso.base.url}/logout.do gatein.sso.filter.login.sso.url=${gatein.sso.server.url}?josso_back_to=${gatein.sso.portal.url}/@@portal.container.name@@/initiatessologinSet JOSSO properties.- Value of Logout filter:
org.gatein.sso.agent.filter.JOSSOLogoutFilter. - Location of JOSSO server
gatein.sso.josso.host. - Change the url
gatein.sso.portal.urlto access the portal on any URL other than.localhost:8080
- The location of the Agent configuration file
gatein.sso.josso.agent.config.fileis relative to classpath. Therefore the agent file location is located atJPP_HOME/gatein/gatein.ear/portal.war/WEB-INF/classes/sso/josso/1.8/josso-agent-config.xml.In most of the cases this file is does not need any properties to be setup.
- JOSSO has some specific dependencies, which differ between various versions. The original
org.gatein.ssoSSO module must be replaced with one appropriate for your version of JOSSO. The alternate modules are available in the JOSSO download.- Delete the
JPP_HOME/modules/org/gatein/ssodirectory. - Copy the
SSO_HOME/josso/gatein-josso-<version>/modules/org/gatein/ssodirectory intoJPP_HOME/modules/org/gatein/.
From now on, all links redirecting to the user authentication pages will redirect to the JOSSO centralized authentication form. If you set Authentication plug-in for JOSSO, you can login with portal credentials (for example, john/gtn) on the JOSSO side.
13.3. Java Open Single Sign-on Version 2.2
JOSSO 2.2 takes a different approach to SSO than JOSSO 1.8. It is designed to allow users to create their own SSO environment by modeling it in a flash web application called
atricore-console.
13.3.1. Setting up Java Open Single Sign-on Server
Prerequisites
- Download JOSSO 2.2.0 from http://www.josso.org
- Follow the instructions from the JOSSO 2 quickstart in http://www.josso.org/confluence/display/JOSSO1/JOSSO2+Quick+start .
- Access the atricore console at
http://server.local.network:8081/atricore-console(server.local.network is the virtual host defined in/etc/hosts).
Procedure 13.2. Java Single Sign-on setup
- Login to the portal with the username/password combination;
admin/admin. - Create a new, empty Identity appliance with the following properties:
Table 13.1.
Setting Value Name MYFIRSTIARealm name com.mycompany.myrealmAppliance location http://server.local.network:8081 - Create a new Identity provider named AcmeIDP (use the default settings).
- Create an Identity vault called IDPUsers and connect it with AcmeIDP via Identity lookup connection.
- Create a Service provider called SP1 but let the hosts to be on.
server.local.network:8081
- Create an Identity vault called SP1Users and wire it with SP1 via Identity lookup connection.
- Create empty temporary directory
/tmp/tomcat7.Create new execution environment of type Tomcat with the following parameters in the atricore console.Table 13.2. Parameters for creating a new execution environment in the atricore console
Setting Value Name SP1EEVersion 7.0.xTarget host LocalInstall home /tmp/tomcat7(the/tmp/tomcat7directory must exist, but it can be empty). - Wire SP1 and SP1EE via an Activation connection.
Note
All parameters of the connection can keep their default values, with the exception of the Partner application location parameter, whose value needs to be changed to http://localhost:8080/portal. - Wire SP1 and AcmeIDP via Federated connection.
- Click Save.
- Go to the Identity appliance life cycle management tab and go through life cycle of Identity appliance ( → → → ) as suggested in the quickstart.
- Go to the Account & Entitlement management tab and create users. Users must be created this way because REST callbacks to the Portal are not supported in this release.This example will create the following user/password accounts:
john/password,root/passwordanddemo/password.
13.3.2. Setting up Java Open Single Sign-on Client
Prerequisites:
Prerequisites
- Set the properties in the SSO configuration file
JPP_HOME/standalone/configuration/gatein/configuration.propertiesExample 13.2. SSO file properties
# SSO gatein.sso.enabled=true gatein.sso.callback.enabled=${gatein.sso.enabled} gatein.sso.login.module.enabled=${gatein.sso.enabled} gatein.sso.login.module.class=org.gatein.sso.agent.login.SSOLoginModule gatein.sso.filter.initiatelogin.enabled=false gatein.sso.filter.initiatelogin.josso2.enabled=true gatein.sso.josso.agent.config.file=sso/josso/2.2/josso-agent-config.xml gatein.sso.josso.properties.file=file:${jboss.home.dir}/standalone/configuration/gatein/configuration.properties gatein.sso.portal.url=http://localhost:8080 gatein.sso.filter.logout.class=org.gatein.sso.agent.filter.JOSSOLogoutFilter gatein.sso.filter.logout.url= gatein.sso.josso.host=server.local.network:8081 gatein.sso.server.url=http://${gatein.sso.josso.host} gatein.sso.josso.identityApplianceId=MYFIRSTIA gatein.sso.josso.partnerAppId=SP1 gatein.sso.josso.partnerAppPoint=SP1EE gatein.sso.filter.login.sso.url=${gatein.sso.server.url}/IDBUS/${gatein.sso.josso.identityApplianceId}/${gatein.sso.josso.partnerAppPoint}/JOSSO/SSO/REDIR?josso_back_to=${gatein.sso.portal.url}/@@portal.container.name@@/josso_security_check&josso_partnerapp_id=${gatein.sso.josso.partnerAppId}Note
The propertygatein.sso.filter.logout.urlis empty because the logout URL will be obtained from the JOSSO agent configuration set in fileJPP_HOME/gatein/gatein.ear/portal.war/WEB-INF/classes/sso/josso/2.2/josso-agent-config.xml. - Update the SSO module in JBoss Enterprise Application Platform 6:
- Delete the
JPP_HOME/modules/org/gatein/ssodirectory. - Copy the
SSO_HOME/josso/gatein-josso-182/modules/org/gatein/ssointoJPP_HOME/modules/org/gatein/directory.
- Test the configuration:
- Start the Portal.
- Access
http://localhost:8080/portaland click Sign in. You will be redirected to the JOSSO instance, but you will need to login with the username and password created via the JOSSO console (for examplejohn/password) as REST callbacks are not supported.
After a successful login to JOSSO, you will be redirected to the portal authenticated asjohn.
