Removing Captcha Implementation
The Captcha implementation on the Contact Us form requires internet accessibility. If you would like to remove the captcha from the form, follow these steps:
- Open the website project in Visual Studio 2008.
- Open the /PagesContactUs.aspx page.
- Remove the <fieldset> element in the <InsertItemTemplate> section of the <CrmEntityFormView> control.
|
Your file should look like this when you are done: |
4. Open the code-behind for the page (ContactUs.aspx.cs). Remove the AddAssiraValidation method and the call to it in the Page_Load method |
Your file should look like this when done: |
Using Active Directory Membership Provider
The default implementation uses Live ID for portal user authentication. The implementation also uses a secure invitation mechanism that also uses a challenge/response mechanism to activate a portal account. This mechanism requires a complex series of steps to enable new portal users and it also requires an active internet connection. Finally, it requires that you set up the portal under a particular domain name and provision a Live ID application. For demonstration purposes, it is more desirable to use a simpler authentication mechanism that can be configured easily. Since the demo VPC is a domain controller, and accounts are already configured, switching the portal to use Active Directory for authentication is fairly desirable.
Follow these steps to change the portal to use Active Directory for user authentication:
1. Open the web project with Visual Studio 2008. 2. Locate the web.config file and insert the following <forms> element into the <authentication> element:
<forms loginUrl="/login" timeout="525600"/> |
3. Add a connection string in the <connectionStrings> section to point to an appropriate OU in Active Directory.
<add name="ADConnectionString" connectionString="LDAP://contoso.com/CN=Users,DC=contoso,DC=com" /> |
Locate and replace the existing membership provider with the following:
<add name="CrmMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ADConnectionString" attributeMapUsername="sAMAccountName"/> |
4. Locate the master page in MasterPages/Default.master and remove the LiveIdLoginStatus control. |
5. Add the LoginStatusControl to the LoggedInTemplate:
<asp:LoginStatus runat="server" />
6. Add an AnonymousTemplate with a CrmHyperLink control:
<AnonymousTemplate> <crm:CrmHyperLink runat="server" SiteMarkerName="Login" /> </AnonymousTemplate>
Your final page should look like this: |
7. Edit the code-behind for that page (default.master.cs) and delete the code that references the LiveLoginStatus control from the Page_Load method: |
8. Locate the /Pages/Login.aspx page. Cut out the LiveIdLoginStatus control. |
and replace it with a standard ASP.NET login control |
9. Locate the code-behind for that page (Login.aspx.cs) and remove the entire else section in the Page_Load method: |
Your file should now look like this: |
10. Open a browser and navigate to your CRM. Create a new contact for the webmaster: |
Switch to the Web Authentication tab and enter the domain username and turn on the Logon Enabled checkbox: |
Save the contact record, then switch to the Web Roles section, then click Add Existing Web Role. Locate and add the Customer Portal Administrators webrole: |
The web roles for the contact should look like this now: |
11. Test the portal.
Start on the home page, anonymously: |
Click on the logon link in the header and enter your network credentials: |
When you successfully log in (watch it, it is case sensitive), you will see the CMS editing controls and the webmaster name in the header: |
Technical Details
The portal framework can work with any ASP.NET membership provider. The portal ships with a membership provider for Live ID, and this example shows how to swap it out for an Active Directory membership provider. You can also use the old SQL Membership provider that was used in the old eService accelerator, or even upgrade to the commercial version of the portals from Adxstudio and use their contact/lead/user based membership providers which allow you to use CRM records for authenticating portal users. |