<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Requests
    PUBLIC "-//iPlanet//iDSAME 5.0 Admin CLI DTD//EN"
    "file:%IDSAME_BASEDIR%/%IDSAME_PRODUCT_DIR%/dtd/amAdmin.dtd"
>
<Requests>

  <!-- register service -->
  <OrganizationRequests DN="%ORG_DN%">
    <RegisterServices>
      <Service_Name>srapGatewayAccessService</Service_Name>
    </RegisterServices>
  </OrganizationRequests>

  <!-- create template -->
  <OrganizationRequests DN="%ORG_DN%">
    <CreateServiceTemplate>
      <Service_Name>srapGatewayAccessService</Service_Name>
    </CreateServiceTemplate>
  </OrganizationRequests>

  <!-- create policy -->
  <OrganizationRequests DN="%ORG_DN%">
    <CreatePolicy createDN="%ORG_DN%">
      <Policy name="To enable Basic Authentication through Gateway" referralPolicy="false">
        <Rule name="To enable Basic Authentication through Gateway">
          <ServiceName name="srapGatewayAccessService" />
          <AttributeValuePair>
            <Attribute name="sunPortalGatewayEnableSSO" />
            <Value>true</Value>
          </AttributeValuePair>
        </Rule>
        <Subjects name="OrgEnableBasicGatewaySSO" description="">
          <Subject name="OrgEnableBasicGatewaySSO" type="Organization">
            <AttributeValuePair>
              <Attribute name="Values"/>
              <Value>%ORG_DN%</Value>
            </AttributeValuePair>
          </Subject>
        </Subjects>
      </Policy>
    </CreatePolicy>
  </OrganizationRequests>

  <!-- add to the cookie domain list -->
  <SchemaRequests serviceName="iPlanetAMPlatformService" SchemaType="Global">
    <AddDefaultValues>
      <AttributeValuePair>
        <Attribute name="iplanet-am-platform-cookie-domains"/>
        <Value>.%GW_DOMAIN%</Value>
      </AttributeValuePair>
    </AddDefaultValues>
  </SchemaRequests>

  <!-- add gateway access service to the required services list -->
  <SchemaRequests serviceName="iPlanetAMAdminConsoleService" SchemaType="Organization">
    <AddDefaultValues>
      <AttributeValuePair>
        <Attribute name="iplanet-am-required-services"/>
        <Value>srapGatewayAccessService</Value>
      </AttributeValuePair>
    </AddDefaultValues>
  </SchemaRequests>

  <!-- create user for logging -->
  <PeopleContainerRequests DN="%PEOPLE_DN%">
    <CreateUser createDN="amService-srapGateway">
      <AttributeValuePair>
        <Attribute name="cn"/>
        <Value>amService-srapGateway</Value>
        </AttributeValuePair>
      <AttributeValuePair>
        <Attribute name="sn"/>
        <Value>amService-srapGateway</Value>
      </AttributeValuePair>
      <AttributeValuePair>
        <Attribute name="userPassword"/>
        <Value>%SRA_LOG_USER_PASSWORD%</Value>
      </AttributeValuePair>
    </CreateUser>
  </PeopleContainerRequests>

  <OrganizationRequests DN="%ORG_DN%">
    <RegisterServices>
      <Service_Name>iPlanetAMAuthConfiguration</Service_Name>
    </RegisterServices>
  </OrganizationRequests>

  <OrganizationRequests DN="%ORG_DN%">
    <AddSubConfiguration subConfigName = "Configurations"
        subConfigId = "Configurations"
        priority = "0"
        serviceName="iPlanetAMAuthConfiguration"/>
  </OrganizationRequests>

  <OrganizationRequests DN="%ORG_DN%">
    <AddSubConfiguration subConfigName = "Configurations/srapGatewayAccessService"
                          subConfigId = "NamedConfiguration"
                          priority = "0"
                          serviceName="iPlanetAMAuthConfiguration">
      <AttributeValuePair>
        <Attribute name="iplanet-am-auth-configuration"/>
        <Value>&lt;AttributeValuePair&gt;&lt;Value&gt;com.sun.identity.authentication.modules.ldap.LDAP SUFFICIENT &lt;/Value&gt;&lt;/AttributeValuePair&gt;</Value>
      </AttributeValuePair>
    </AddSubConfiguration>
  </OrganizationRequests>

  <RoleRequests DN="cn=deny write access,%ORG_DN%">
    <AddUsers>
      <DN>uid=amService-srapGateway,%PEOPLE_DN%</DN>
    </AddUsers>
  </RoleRequests>

  <!-- update online help -->
  <SchemaRequests serviceName="iPlanetAMAdminConsoleService" SchemaType="Organization">
    <AddDefaultValues>
      <AttributeValuePair>
        <Attribute name="iplanet-am-admin-console-online-help"/>
        <Value>SRA Help|ps/srahelp.html|srapGatewayAdminConsole|%DYNAMIC_URL%</Value>
      </AttributeValuePair>
    </AddDefaultValues>
  </SchemaRequests>

</Requests>

