JBoss.orgCommunity Documentation

Chapter 3. Web Single Sign On (SSO)

3.1. SAML v2 based Web SSO
3.1.1. Configuring the Identity Provider (IDP)
3.1.2. Configure the Service Provider (SP)

In this chapter, we will look at usage of JBoss Identity Federation to help you obtain a platform to implement federated identity based services (including centralized identity services and Single Sign-On (SSO) for applications).

This section will talk about the configuration information to support the SAML V2.0 based Web Single Sign On (SSO). The SAML profile that is implemented is the HTTP/Redirect binding with centralized identity services to enable web SSO for your applications.

The architecture follows the Hub and Spoke architecture of Identity Management. An Identity Provider (IDP) acts as the central source (hub) for identity and role information to all the applications (Service Providers/SP). The spokes are the Service Providers (SP).

The IDP can be a JBoss Application Server or a Tomcat instance.

You need to configure a web application as the Identity provider.

The web application needs to have FORM or BASIC based security enabled in its web.xml. We recommend the use of FORM based web application security as it gives you the ability to customize the login page.

The web.xml needs to have a configuration such as the following:



           <?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5">

  <display-name>IDP</display-name>
  <description>IDP</description>

  <!-- Define a security constraint that gives unlimited access to images -->
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Images</web-resource-name>
      <url-pattern>/images/*</url-pattern>
    </web-resource-collection>
  </security-constraint>

    <!-- Define a Security Constraint on this Application -->
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>IDP</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
       <role-name>manager</role-name>
    </auth-constraint>
  </security-constraint>

  <!-- Define the Login Configuration for this Application -->
  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>IDP Application</realm-name>
    <form-login-config>
       <form-login-page>/jsp/login.jsp</form-login-page>
       <form-error-page>/jsp/loginerror.jsp</form-error-page>
    </form-login-config>
  </login-config>

  <!-- Security roles referenced by this web application -->
  <security-role>
    <description>
      The role that is required to log in to the IDP Application
    </description>
    <role-name>manager</role-name>
  </security-role>
</web-app>
           

The SP can be a JBoss Application Server or a Tomcat instance.

You need to configure a web application as the Service Provider(SP).

The web application needs to have FORM based security enabled in its web.xml.

The web.xml needs to have a configuration such as the following:




 <?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5"> 

  <display-name>Test SALES Application</display-name>
  <description>
    Just a Test SP
  </description>

  <!-- Define a Security Constraint on this Application -->
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>SALES Application</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
       <role-name>manager</role-name>
    </auth-constraint>
  </security-constraint>

  <!-- Define a security constraint that gives unlimted access to freezone -->
  <security-constraint>
    <web-resource-collection>
     <web-resource-name>freezone</web-resource-name>
     <url-pattern>/freezone/*</url-pattern>
    </web-resource-collection>
  </security-constraint>

  <!-- Define the Login Configuration for this Application -->
  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Tomcat SALES Application</realm-name>
    <form-login-config>
       <form-login-page>/jsp/login.jsp</form-login-page>
       <form-error-page>/jsp/loginerror.jsp</form-error-page>
    </form-login-config>
  </login-config>

  <!-- Security roles referenced by this web application -->
  <security-role>
    <description>
      The role that is required to log in to the SP Application
    </description>
    <role-name>manager</role-name>
  </security-role>
</web-app>