This document describes the web-based reference implementation of a SAML-based single sign-on (SSO) service that logs users in to Google Apps. The web application is a PHP application that generates and sends SAML requests, receives and parses SAML requests, calls a function to authenticate users, and then returns a SAML response to the user's browser. The browser must then send the SAML response on to the Assertion Consumer Service (ACS) URL to log the user into Google Apps. The identity provider can choose the appropriate mechanism to use to trigger the post of the SAML response, but possible solutions include a button that the user clicks or a JavaScript function.

This document contains an overview of the code included in the SAML reference package. It also describes a three-stage process for partners who are using the reference implementation as a guide during their own development process.

The following references may help you to implement a SAML-based SSO service:

Understanding the SAML Reference Code

The SAML reference code performs two types of functionality.

  1. The code creates and sends SAML requests. This is functionality that the service provider performs in a SAML transaction.
  2. The code receives and parses SAML requests, calls a function to authenticate users and then generates and sends SAML responses. This is functionality that the identity provider performs in a SAML transaction.

The PHP SAML reference implementation uses a web server with PHP 5 installed, and requires the xmlsec binary for signing the XML SAML response.

File and Directory Structure for SAML Reference Code

The following list identifies the file and directory structure of the SAML reference code. File or directory names shown in bold, blue text identify files that perform functions handled by the identity provider in a SAML transaction. The remaining files and directories in the list either perform functions handled by the sevice provider in a SAML transaction or they are used exclusively in the user interface (UI). (In practice, your SAML-based SSO service will not need to have a user interface; however, you may want to adapt the UI provided in the reference package to use for debugging purposes.)

Creating a SAML-based SSO Service for your Site

This section explains how you can use Google's SAML reference implementation to implement a SAML-based SSO service that allows users to log in to Google Apps through your site. This document prescribes a three-stage process for partners who plan to use the reference implementation as a guide during their integration process.

  1. Stage I explains the steps for installing the code for the reference implementation and verifying that the reference implementation works on your site.

  2. Stage II explains code modifications that you would make so that the sample code will direct SAML requests to your internal user authentication application. In this stage, you will modify the application to authenticate a user and verify that the user can access Google Apps.

  3. Stage III explains further code modifications that you will need to make so that authenticated users are logged in to Google Apps for your domain rather than Google's SAML demo site.

Stage I: Installing the Code

Stage II: Sending SAML Requests to an Internal User Authentication Application

Stage III: Logging Users into Google Apps

Appendix A - XML Formats for SAML Requests and Responses

The SAML reference package includes templates for SAML requests and SAML responses.


© Google Inc. 2007. All Rights Reserved.