Friday, February 18, 2011

IFD Authentication OR AD athentication?

Brief introduction to IFD and deplyment steps:
IFD allows the customers to configure their CRM system to be reachable from outside the intranet. It might be internet or outside of the firewal.

The main difference when using IFD vs. typical on-premise deployment is how users are authenticated.

When using the on-premise version, IIS handles most of the authentication via integrated windows authentication.

For the IFD, we need to make use of custom CRM Authentication handler modules while setting up. In IFD, the web site is opened for anonymous access and the authentication relies on the presence of the CRM ticket cookie. This cookie is obtained by starting off from a sign-in page.

The Internet Facing Deployment steps:
In order to access the custom pages via AD authentication and IFD Authentication following are some of the main steps.

1) Place your build code in the IFV Folder
2) The Custom ASP.net pages must be in side the CrmAppPool

Your published folder should contain
a) custom aspx page with an assembly reference
b) Resource folder in case if you have used any.
c) bin folder, which contains the assembly

How to register the assembly name?
Go to the properties on the Webapplication project and set the Assembly name.
Register the assembly name in the .aspx page at the top. For example ()

4) Add the organization name to the querystring
5) Use the CrmImpersonator class. All access to the Crm web services needs to be wrapped within the using (new CrmImpersonator()) block.
6) Use the ExtractCrmAuthenticationToken static method. This is necessary to get the context of the calling user.
7) Use CredentialCache.DefaultCredentials to pass AD credentials to the Crm web services.

Accessing the page from an internal address:
http://[server]/[orgname]/ISV/TestFolder/TestPage.aspx

Accessing the page from an external address:
http://[orgname].[server name (Fully qualified domain name)]/ISV/TestFolder/TestPage.aspx

Hope this helps,
Chaitanya...