Configuring Form Authentication for the HTML Content In Body With Requests Processor
Configuring Form Authentication for the HTML Content In Body With Requests Processor
Form authentication allows you to index the HTML of your Sitecore items that can only be accessed while being authenticated.
This method uses the credentials entered in the Coveo.SearchProvider.Custom.config, which are initially configured during the installation of the Coveo for Sitecore package, to log in.
|
|
The password is encrypted in the |
One of the use cases of this method is with the HtmlContentInBodyWithRequestsProcessor pipeline, which uses an Http Get request to fetch the content of a page at indexing time, and attempts a form authentication using the Post method when the page is secured.
To configure your processor to allow form authentication, follow these steps:
-
Open the
Coveo.SearchProvider.Custom.configfile. It’s usually located under<Sitecore Instance>\Website\App_Config\Include\Coveo. -
In the
defaultIndexConfigurationnode, add the following nodes:<formsAuthConfiguration type="Coveo.Framework.Configuration.FormsAuthConfiguration, Coveo.Framework"> <formsAuthLoginPage></formsAuthLoginPage> <formsAuthUserControl></formsAuthUserControl> <formsAuthPasswordControl></formsAuthPasswordControl> <formsAuthLoginCommand></formsAuthLoginCommand> </formsAuthConfiguration> -
Enter the following information in the nodes:
-
formsAuthLoginPage: the URL of your login page. -
formsAuthUserControl: theidof the username text field. -
formsAuthPasswordControl: theidof the password text field.NoteYou can obtain the
idof those fields by inspecting the logging page with your browser of choice. -
formsAuthLoginCommand: Enter thenameof the button and itsvalue, with the following syntax:name=valueNoteSpaces have to be replaced with the
+symbol.
-
-
Save and close the file.
-
Rebuild your indexes (see Coveo for Sitecore Indexing Guide).
ExampleYou want to index content from your
http://www.secured.comSitecore website. You can access the authentication page of the website throughhttp://www.secured.com/sitecore/login.In your
Coveo.SearchProvider.Custom.configfile, underdefaultIndexConfiguration, you enter the following nodes:<formsAuthConfiguration type="Coveo.Framework.Configuration.FormsAuthConfiguration, Coveo.Framework"> <formsAuthLoginPage>http://www.secured.com/sitecore/login</formsAuthLoginPage> <formsAuthUserControl>UserName</formsAuthUserControl> <formsAuthPasswordControl>Password</formsAuthPasswordControl> <formsAuthLoginCommand>ctl09=Log+in</formsAuthLoginCommand> </formsAuthConfiguration>