Index
Introduction
This guide will walk you through the steps to get a JOSSO 1.8.4 Agent build up and running in Tomcat 7.0.x.
Prerequisites
To make a quick JOSSO setup we will need:
- JDK 1.6
- Tomcat 7.0.x
- JOSSO 1.8.4
For the purposes of this guide, we will assume the following facts:
- JDK 1.6.0 is located at /opt/jdk1.6.0
- Tomcat 7.0.8 is located at /opt/apache-tomcat-7.0.8
- JOSSO 1.8.4 is located at /opt/josso-1.8.4
Install
First we will start JOSSO Deployment Console.
$ cd /opt/josso-1.8.4/bin
$ ./josso-gsh
__ _____ _____ _____ _____
__| | | __| __| |
| | | | |__ |__ | | |
|_____|_____|_____|_____|_____|
JOSSO (1.8.4)
Type 'help' for more information.
--------------------------------------
josso>
Now we have to execute the agent install command as shown below:
josso> agent install --target /opt/apache-tomcat-7.0.8 --platform tc70
You should see something like this :
josso> agent install --target /opt/apache-tomcat-7.0.8 --platform tc70 Installing Apache Tomcat 7.0.x JOSSO Agent v.1.8.4 Verify Target Apache Tomcat 7.0.x Apache Tomcat 7.0.x [OK ] Directory Layout CatalinaHome [OK ] Installing JOSSO 3rd party JARs Installing [spring-aop-2.5.5.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/spring-aop-2.5.5.jar Installing [commons-beanutils-1.6.1.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-beanutils-1.6.1.jar Installing [commons-discovery-0.2.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-discovery-0.2.jar Installing [commons-lang-2.0.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-lang-2.0.jar Installing [commons-digester-1.5.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-digester-1.5.jar Installing [spring-beans-2.5.5.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/spring-beans-2.5.5.jar Installing [activation-1.1.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/activation-1.1.jar Installing [aopalliance-1.0.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/aopalliance-1.0.jar Installing [xbean-spring-3.4.3.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/xbean-spring-3.4.3.jar Installing [commons-collections-3.0.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-collections-3.0.jar Installing [commons-modeler-1.1.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-modeler-1.1.jar Installing [axis-saaj-1.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/axis-saaj-1.4.jar Installing [commons-httpclient-3.1.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-httpclient-3.1.jar Installing [commons-logging-api-1.0.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-logging-api-1.0.4.jar Installing [axis-wsdl4j-1.5.1.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/axis-wsdl4j-1.5.1.jar Installing [axis-jaxrpc-1.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/axis-jaxrpc-1.4.jar Installing [commons-codec-1.3.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-codec-1.3.jar Installing [axis-1.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/axis-1.4.jar Installing [spring-core-2.5.5.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/spring-core-2.5.5.jar Installing [spring-context-2.5.5.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/spring-context-2.5.5.jar Installing [axis-ant-1.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/axis-ant-1.4.jar Installing [commons-logging-1.0.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/commons-logging-1.0.4.jar Installing JOSSO Agent JARs Installing [josso-agents-bin-1.8.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/josso-agents-bin-1.8.4.jar Installing [josso-agent-shared-1.8.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/josso-agent-shared-1.8.4.jar Installing [josso-tomcat70-agent-1.8.4.jar] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/josso-tomcat70-agent-1.8.4.jar Installing JOSSO Agent JARs from Source Configuring Container Removed [Tomcat default Realm ] [OK ] org.apache.catalina.realm.UserDatabaseRealm Configured [JOSSO JAAS Realm ] [OK ] org.josso.tc70.agent.jaas.CatalinaJAASRealm Configured [JOSSO Agent Valve ] [OK ] org.josso.tc70.agent.SSOAgentValve Backup [server.xml] [OK ] file:///opt/apache-tomcat-7.0.8/conf/server.xml.bkp.1 Save [server.xml] [OK ] file:///opt/apache-tomcat-7.0.8/conf/server.xml Installing JOSSO Agent Configuration files Installing [jaas.conf] [OK ] Created file:///opt/apache-tomcat-7.0.8/conf/jaas.conf Installing [josso-agent-config.xml] [OK ] Created file:///opt/apache-tomcat-7.0.8/lib/josso-agent-config.xml Installing [setenv.sh] [OK ] Created file:///opt/apache-tomcat-7.0.8/bin/setenv.sh Installing [setenv.bat] [OK ] Created file:///opt/apache-tomcat-7.0.8/bin/setenv.bat Apache Tomcat 7.0.x JOSSO Agent v.1.8.4 Overall Installation [OK ] Successfull! Congratulations! You successfully installed the agent. Now Follow the JOSSO Agent Configuration guide and setup your SSO Partner applications ! josso>
You can see all the console activity, this information will also be recorded in a log file created in josso-1.8.4/log/.
Configure
The Single Sign-On Agent Configuration is installed in $CATALINA_HOME/lib/ directory.
Let's take a look at an example Single Sign-On Agent configuration file :
<?xml version="1.0" encoding="UTF-8" ?> <s:beans xmlns:s="http://www.springframework.org/schema/beans" xmlns:tc70="urn:org:josso:agent:tomcat70" xmlns:agent="urn:org:josso:agent:core" xmlns:protocol="urn:org:josso:protocol:client" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd urn:org:josso:agent:tomcat70 http://www.josso.org/schema/josso-tomcat70-agent.xsd urn:org:josso:agent:core http://www.josso.org/schema/josso-agent.xsd urn:org:josso:protocol:client http://www.josso.org/schema/josso-protocol-client.xsd"> <tc70:agent name="josso-tomcat70-agent" sessionAccessMinInterval="1000"> <!-- Gateway LOGIN and LOGOUT URLs --> <gatewayLoginUrl>http://localhost:8080/josso/signon/login.do</gatewayLoginUrl> <gatewayLogoutUrl>http://localhost:8080/josso/signon/logout.do</gatewayLogoutUrl> <!-- Gateway service locator --> <gatewayServiceLocator> <!-- Other properties for ws-service-locator : username, password, servicesWebContext, transportSecurity --> <protocol:ws-service-locator endpoint="localhost:8080" /> </gatewayServiceLocator> <configuration> <agent:agent-configuration> <!-- ============================================================================= --> <!-- --> <!-- JOSSO Parnter application definicions : --> <!-- --> <!-- Configure all web applications that should be a josso partner application --> <!-- within this server. --> <!-- For each partner application you have to define the proper web-context. --> <!-- ============================================================================= --> <agent:partner-apps> <!-- Simple definition of a partner application --> <agent:partner-app id="MyPartnerApp1" context="/partnerapp" /> </agent:partner-apps> </agent:agent-configuration> </configuration> </tc70:agent> </s:beans>
Using this configuration you can set :
- The Gateway Login URL, where the Single Sign-On Agent will redirect the user on protected resource access request so that he can authenticate.
- The Gateway Logout URL, where the Single Sign-On Agent will redirect the user on logout request.
- The concrete Service Locator to be used to invoke the services of the Single Sign-On Gateway.
- The Single Sign-On partner applications
In this specific case, which is the default, we are using SOAP over HTTP to invoke The Single Sign-On Gateway WebServices.
Its important to specify the endpoint configuration parameter which should contain the host and port information where the Single Sign-On WebServices are listening.
If the agent and the gateway are running in the same server this will be localhost and the port should be the port where Tomcat is listening for incoming HTTP requests.
This configuration file defines only one partner application associated with the /partnerapp web context. This means that the web application associated with the /partnerapp web context will be put behind the Single Sign-On. You can define other partner applications.
You can also take a look at the distributed configuration file for Tomcat 7.0.x located in josso-1.8.4/dist/agents/config/tc70/josso-agent-config.xml
| Logging in Tomcat If you want to enable JOSSO logging in Tomcat, refer to http://tomcat.apache.org/tomcat-7.0-doc/logging.html . |