<?xml version="1.0" encoding="UTF-8"?>
<!--
  ! CCPL HEADER START
  !
  ! This work is licensed under the Creative Commons
  ! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
  ! To view a copy of this license, visit
  ! http://creativecommons.org/licenses/by-nc-nd/3.0/
  ! or send a letter to Creative Commons, 444 Castro Street,
  ! Suite 900, Mountain View, California, 94041, USA.
  !
  ! You can also obtain a copy of the license at
  ! src/main/resources/legal-notices/CC-BY-NC-ND.txt.
  ! See the License for the specific language governing permissions
  ! and limitations under the License.
  !
  ! If applicable, add the following below this CCPL HEADER, with the fields
  ! enclosed by brackets "[]" replaced with your own identifying information:
  !      Portions Copyright [yyyy] [name of copyright owner]
  !
  ! CCPL HEADER END
  !
  !      Copyright 2011 ForgeRock AS
  !    
-->
<chapter xml:id='chap-gateway-templates'
 xmlns='http://docbook.org/ns/docbook'
 version='5.0' xml:lang='en'
 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
 xsi:schemaLocation='http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd'
 xmlns:xlink='http://www.w3.org/1999/xlink'
 xmlns:xinclude='http://www.w3.org/2001/XInclude'>
 <title>Configuration Templates</title>

 <para>This chapter contains templates of common configurations. Start with one
 of our templates and then modify to suit your deployment. Read the summary of
 each template to find the right match for your application. If you are not
 sure about the characteristics of your application, start with the basic
 Application Capture template. This template allows you to setup basic proxying
 and capture the traffic of the login sequence in a flat file, which will then
 allow you to analyze the application and subsequently choose the right
 template or add your own configuration.</para>

 <note>
  <itemizedlist>
   <listitem>
    <para>All templates have the <literal>CaptureFilter</literal> enabled by
    default. Remove the capture filter from the outgoing chain before running
    the gateway in production. Capturing is typically used only for initial
    development or debugging and may rapidly fill up your available disk space
    if left enabled.</para>
   </listitem>
   <listitem>
    <para>Substitute the TARGETIP tag with the IP Address of your
    application.</para>
   </listitem>
   <listitem>
    <para>Modify the <literal>LoginRequest</literal> filter to match the form
    required for login by your target application.</para>
   </listitem>
  </itemizedlist>
 </note>
  
 <section>
  <title>Proxy &amp; Capture</title>
  <para>Proxies all requests and captures them in a flat file. Use this
  template if you need to analyze the traffic for your application. Simply
  change the <literal>baseURI</literal> to be that of the target application,
  restart the Gateway, and login to the application. The entire sequence will
  be logged to the flat file.</para>
  
  <para><link xlink:href='TODO'>Template</link></para>
 </section>

 <section>
  <title>Simple Login Form</title>
  <para>Logs the user into the target application with hard-coded username
  and password. This template intercepts the login page request and replaces
  it with the login form.</para>
  
  <para><link xlink:href='TODO'>Template</link></para>
 </section>

 <section>
  <title>Login Form With Cookie From Login Page</title>
  <para>For applications that expect a cookie from the login page to be sent
  in the login request form. This templates allows the login page request to
  go through to the target, intercepts the response, then creates the login
  form and adds the intercepted cookie to the POST.</para>
  
  <para><link xlink:href='TODO'>Template</link></para>
 </section>

 <section>
  <title>Login Which Requires a Hidden Value From the Login Page</title>
  <para>Extracts a hidden value from the login page and includes it in the
  login form POSTed to the target application.</para>
  
  <para><link xlink:href='TODO'>Template</link></para>
 </section>

 <section>
  <title>HTTP &amp; HTTPS Application</title>
  <para>Proxies traffic to an application listening on ports 80 and 443. The
  assumption is the application uses HTTPS for authentication and HTTP for the
  general application features. Assuming the login will all take place on
  port 443, you will need to add the login filters and handlers to the
  <literal>LoginChain</literal>. To get started quickly, modify the
  <literal>baseURI</literal> to be the <literal>IPAddress</literal> of your
  target application. This should allow you to proxy all traffic to the
  application. Then add the logic for the <literal>LoginChain</literal> using
  the flow from one of the login templates.</para>
  
  <para><link xlink:href='TODO'>Template</link></para>
 </section>

 <section>
  <title>Access Management Integration With Headers</title>
  <para>Logs the user into the target application using the headers passed down
  from an Access Management agent. This template assumes the username and
  password are passed down by the Access Manager agent as headers. If the
  header passed in contains only a username or subject and requires a lookup to
  an external datasource, you will need to add an attribute filter to the chain
  to retrieve the credentials.</para>
  
  <para><link xlink:href='TODO'>Template</link></para>
 </section>

 <section>
  <title>Microsoft Online Outlook Web Access</title>
  <para>A sample template used to log a user into Microsoft Online Outlook Web
  Access. This template shows how you would use the Gateway and the OpenAM
  password capture feature to integrate with OWA.</para>
  
  <para><link xlink:href='TODO'>Template</link></para>
 </section>
</chapter>
