Added by Sebastian Gonzalez Oyuela, last edited by Sebastian Gonzalez Oyuela on Aug 25, 2009  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Index

Introduction

This guide will walk you through the steps to get a JOSSO 1.8 Agent build up and running in JBoss 4.2.

Prerequisites

To make a quick JOSSO setup we will need:

For the purposes of this guide, we will assume the following facts:

  • JDK 1.5.0 16 is located at /opt/jdk1.5.0_16
  • JBoss 4.2.3.GA is located at /opt/jboss-4.2.3.GA
  • JOSSO 1.8.0 is located at /opt/josso-1.8.0

Install

First we will start JOSSO Deployment Console.

$ cd /opt/josso-1.8.0/bin
$ ./josso-gsh
    __ _____ _____ _____ _____ 
 __|  |     |   __|   __|     |
|  |  |  |  |__   |__   |  |  |
|_____|_____|_____|_____|_____|

 JOSSO (1.8.0)

Type 'help' for more information.
--------------------------------------
josso> 

Now we have to execute the agent install command as shown below:

josso> agent install --target /opt/jboss-4.2.3.GA --jboss-instance default --platform jb42

You should see something like this :

josso> agent install --target /opt/jboss-4.2.3.GA --jboss-instance default --platform jb42

Installing JBoss AS 4.2.x JOSSO Agent v.1.8.0

Verify Target JBoss AS 4.2.x
  JBoss AS 4.2.x                                           [OK   ] Directory Layout
  JBossHome                                                [OK   ] 

Installing JOSSO 3rd party JARs
  Installing    [spring-aop-2.5.5.jar]                     [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/spring-aop-2.5.5.jar
  Installing    [commons-beanutils-1.6.1.jar]              [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-beanutils-1.6.1.jar
  Installing    [commons-discovery-0.2.jar]                [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-discovery-0.2.jar
  Installing    [commons-lang-2.0.jar]                     [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-lang-2.0.jar
  Installing    [commons-digester-1.5.jar]                 [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-digester-1.5.jar
  Installing    [spring-beans-2.5.5.jar]                   [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/spring-beans-2.5.5.jar
  Installing    [activation-1.1.jar]                       [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/activation-1.1.jar
  Installing    [aopalliance-1.0.jar]                      [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/aopalliance-1.0.jar
  Installing    [xbean-spring-3.4.3.jar]                   [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/xbean-spring-3.4.3.jar
  Installing    [commons-collections-3.0.jar]              [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-collections-3.0.jar
  Installing    [commons-modeler-1.1.jar]                  [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-modeler-1.1.jar
  Installing    [axis-saaj-1.4.jar]                        [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/axis-saaj-1.4.jar
  Installing    [commons-httpclient-3.1.jar]               [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-httpclient-3.1.jar
  Installing    [commons-logging-api-1.0.4.jar]            [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-logging-api-1.0.4.jar
  Installing    [axis-jaxrpc-1.4.jar]                      [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/axis-jaxrpc-1.4.jar
  Installing    [commons-codec-1.3.jar]                    [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-codec-1.3.jar
  Installing    [axis-1.4.jar]                             [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/axis-1.4.jar
  Installing    [spring-core-2.5.5.jar]                    [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/spring-core-2.5.5.jar
  Installing    [spring-context-2.5.5.jar]                 [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/spring-context-2.5.5.jar
  Installing    [axis-ant-1.4.jar]                         [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/axis-ant-1.4.jar
  Installing    [commons-logging-1.0.4.jar]                [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/commons-logging-1.0.4.jar

Installing JOSSO Agent JARs
  Installing    [josso-tomcat55-agent-1.8.0.jar]           [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/josso-tomcat55-agent-1.8.0.jar
  Installing    [josso-agents-bin-1.8.0.jar]               [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/josso-agents-bin-1.8.0.jar
  Installing    [josso-agent-shared-1.8.0.jar]             [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/josso-agent-shared-1.8.0.jar
  Installing    [josso-jboss42-agent-1.8.0.jar]            [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/lib/josso-jboss42-agent-1.8.0.jar

Installing JOSSO Agent JARs from Source

Configuring Container
  Removed       [Tomcat default Realm ]                    [OK   ] org.jboss.web.tomcat.security.JBossSecurityMgrRealm
  Configured    [JOSSO JAAS Realm ]                        [OK   ] org.josso.jb42.agent.JBossCatalinaRealm
  Configured    [JOSSO Agent Valve ]                       [OK   ] org.josso.tc55.agent.SSOAgentValve
  Backup        [server.xml]                               [OK   ] file:///opt/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer/server.xml.bkp.1
  Save          [server.xml]                               [OK   ] file:///opt/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer/server.xml
  Configured    [JOSSO JAAS Login Module ]                 [OK   ] org.josso.jb42.agent.JBossSSOGatewayLoginModule
  Backup        [login-config.xml]                         [OK   ] file:///opt/jboss-4.2.3.GA/server/default/conf/login-config.xml.bkp.1
  Save          [login-config.xml]                         [OK   ] file:///opt/jboss-4.2.3.GA/server/default/conf/login-config.xml

Installing JOSSO Agent Configuration files
  Installing    [josso-agent-config.xml]                   [OK   ] Created file:///opt/jboss-4.2.3.GA/server/default/conf/josso-agent-config.xml

JBoss AS 4.2.x JOSSO Agent v.1.8.0
  Overall Installation                                     [OK   ] Successfull!

Congratulations! You successfully installed the agent.
Now Follow the JOSSO Agent Configuration guide and setup your SSO Partner applications !

You can see all the console activity, this information will also be recorded in a log file created in josso-1.8.0/log/.

Configure

The Single Sign-On Agent Configuration is installed in $JBOSS_HOME/server/default/conf directory. This may vary depending on the JBoss instance you used when installing the agent.

Let's take a look at an example Single Sign-On Agent configuration file :

josso-agent-config.xml
<?xml version="1.0" encoding="UTF-8" ?>

<s:beans xmlns:s="http://www.springframework.org/schema/beans"
         xmlns:jb42="urn:org:josso:agent:jboss42"
         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:jboss42 http://www.josso.org/schema/josso-jboss42-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">

    <jb42:agent name="josso-jboss42-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>
                    <agent:partner-app id="MyPartnerApp1" context="/partnerapp" />
                </agent:partner-apps>
            </agent:agent-configuration>
        </configuration>

    </jb42: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 JBoss 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 JBoss 4.2 located in josso-1.8-0/dist/agents/config/jb42/josso-agent-config.xml

Next Steps

Jossify your application for JBoss - Quick Start