Gateway Installation

= Introduction = This guide considers that your web-container is tomcat-7.x (the instructions are very similar for other web-containers) and that you have a JDK distribution (at least Version 1.5). Additionally, in order to store the user account, a MySQL server 5.x is also required.

The JOSSO distribution contains a script that installs automatically all configuration files and libraries that the security service requires. This script can be started with the following command: ./$JOSSO_HOME/bin/josso-gsh. This command starts a josso-console, where you can perform several tasks like the installation of samples, the installation of agents and the installation of the gateway.

In order to install the gateway, you should execute following command in the josso-console: gateway install --target YOUR_TOMCAT_ROOT --platform tc70 --persistence db. This action will install the following list of files in the libraries directory of your tomcat distribution: The last action will also copy a .war file in YOUR_TOMCAT_ROOT/webapps. This file is called josso.war and it is the web service that is called, when an agent need to authenticate or authorized a user.
 * josso-credentials.xml
 * josso-gateway-auth.xml
 * josso-gateway-config.xml
 * josso-gateway-db-stores.xml
 * josso-gateway-db-stores.xml
 * josso-gateway-jmx.xml
 * josso-gateway-ldap-stores.xml
 * josso-gateway-memory-stores.xml
 * josso-gateway-selfservices.xml
 * josso-gateway-web.xml
 * josso-users.xml

= User Account Storage = A MySQL database is used to store the user accounts. The file josso-gateway-stores.xml should be modified in order to do possible the connection to the database. This file should contains only one db-istore:jdbc-store element and it should look like this:

<db-istore:jdbc-store id="josso-identity-store" driverName="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/josso" connectionName="" connectionPassword="" userQueryString="SELECT LOGIN AS NAME FROM JOSSO_USER WHERE LOGIN = ?" rolesQueryString="SELECT NAME AS ROLE FROM JOSSO_USER_ROLE WHERE LOGIN = ?" credentialsQueryString="SELECT LOGIN AS USERNAME, PASSWORD FROM JOSSO_USER WHERE LOGIN = ?" userPropertiesQueryString="SELECT NAME, VALUE FROM JOSSO_USER_PROPERTY WHERE LOGIN = ?" resetCredentialDml="UPDATE JOSSO_USER SET PASSWORD = ? WHERE LOGIN = ?" relayCredentialQueryString="SELECT LOGIN FROM JOSSO_USER WHERE #?# = ?" />

The JOSSO gateway implements a JDBC interface to communicate to the database. This interface requires a MySQL-JDBC connector that it is not automatically installed by the script josso-gsh. For this reason it should be manually copied into YOUR_TOMCAT_ROOT/lib.