Wednesday, June 27, 2012

SharePoint 2010 UAG : FormLoginDataDefinitions.xml and FormLoginCustom.xml


I followed below blog to configure single sign on in SharePoint.
http://microsoft-iag.blogspot.com/2010/10/uagenable-sso-by-passing-user.html

Andy provided only screen shots in his blog where people cannot copy easily. So I am providing code here to copy easily.

FormLoginDataDefinitions.xml

  <SCRIPT name="SharepointFBA">
      <!-- Possible value javascript or vbscript, if javascript tag could be omitted-->
      <LANGUAGE>javascript</LANGUAGE>
      <!-- Possible value cdata or base64, if javascript tag could be omitted-->
      <!-- Notice that searching for the element to submit is done by id, which by convention is seperated by underlines instead of dollar signs -->
      <BODY encoding="cdata">
        <![CDATA[

                              function FormLoginSubmit()
                              {   
                                    formsCol = document.forms;
                                    if (formsCol.length == 1)
                                    {
                                          try{
                                          var submitbtn = document.getElementById('ctl00_PlaceHolderMain_signInControl_login');
                                          if (submitbtn)
                                                submitbtn.click();
                                        }catch(e){}
                                    }
                                    return false;
                              }
                       
                        ]]>
      </BODY>
    </SCRIPT>


FormLoginCustom.xml

<WHLFILTFORMLOGIN ver="1.0">
      <!-- app_id added by configurator, dont edit -->
    <APPLICATION>
            <APPLICATION_TYPE>SharepointFBA</APPLICATION_TYPE>
           
            <!-- USAGE section is mandatory. "description=" could be "change_password" or "form_login" -->
            <USAGE description="form_login">

            <PRIMARY_HOST_URL><![CDATA[/_forms/default.aspx.*]]></PRIMARY_HOST_URL>
           
            <SCRIPT_NAME source="data_definition">SharepointFBA</SCRIPT_NAME>
           
            <!-- USER_AGENT could be of any type defined in FormLoginDataDefinitions.xml.  any, ie, netscape are used for back compatibility -->
            <USER_AGENT>
                  <!-- AGENT_TYPE could be of any type defined in FormLoginDataDefinitions.xml -->
                  <!-- "search=group" indicates all the values in the tag USER_AGENT_GROUP from FormLoginDataDefinitions.xml -->
                  <AGENT_TYPE search="group">all_supported</AGENT_TYPE>
                  <!-- POLICY should be "multiplatform" or "limited" -->
                  <!-- use "limited" if only "change_password" takes place -->
                  <POLICY>multiplatform</POLICY>
                  <!-- the name of the function to be injected to the form. Not recomended for customization-->
                  <SCRIPT_NAME source="data_definition">FormLoginHandler</SCRIPT_NAME>
            </USER_AGENT>
           
            <LOGIN_FORM>
                  <!-- one of NAME or ID could be used. Value could be blank if no form search required -->
                  <NAME>aspnetForm</NAME>
                  <!-- METHOD could be POST or GET -->
                  <METHOD>POST</METHOD>
                  <!-- CONTROL handling could be "dummy_value", "app_default", "real_value", "conf_default", "user_input" -->
                  <CONTROL handling="dummy_value">
                        <!-- TYPE could only be USER_NAME, PASSWORD, DOMAIN, DOMAIN_USER, USER_PROVIDED, NEW_PASSWORD -->
                        <TYPE>USER_NAME</TYPE>
                        <NAME>ctl00$PlaceHolderMain$signInControl$UserName</NAME>
                        <DEF_VALUE>siteusr</DEF_VALUE>
                  </CONTROL>
                  <CONTROL handling="dummy_value">
                        <TYPE>PASSWORD</TYPE>
                        <NAME>ctl00$PlaceHolderMain$signInControl$password</NAME>
                        <DEF_VALUE>sitepass</DEF_VALUE>
                  </CONTROL>
    </LOGIN_FORM>
     
            </USAGE>
      </APPLICATION>
</WHLFILTFORMLOGIN>

2 comments:

  1. I think its configuration issue only.

    as you said, If I select forms it autopopulates the username as siteusr (literally). and password is all dots.
    so far it is working as expected.

    check one more time below tags

    SCRIPT name="SharepointFBA"
    SCRIPT_NAME source="data_definition">SharepointFBA

    do you have this page "_forms/default.aspx" ?

    ReplyDelete
  2. http://suryapulipati.blogspot.com/2012/06/sharepoint-2010-with-uag-sso.html

    ReplyDelete

Followers