MCRM40_ENUS_EXT_09 - FTP Directory Listing

acceptableseashoreΑσφάλεια

5 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

100 εμφανίσεις

Extending Microsoft Dynamics™ CRM 4.0

Chapter 9


ASP .Net Extensions

Overview


Configuring custom ASP .Net applications that
run within the Microsoft Dynamics CRM Web
site


Authentication and impersonation mechanisms
within a custom ASP .Net application


Deploying a custom ASP .Net application within
the Microsoft Dynamics CRM Web site

2

of 10

Lesson:
Web.config settings in Microsoft Dynamics CRM


Microsoft Dynamics CRM 4.0 is an ASP .Net 2.0
application installed in the root of a Web site.


Web.config settings affect any other ASP .Net
applications within the Web site:


httpModules Element


pages Element


3

of 10

Web.config settings in Microsoft Dynamics CRM


httpModules Element


Two HttpModules are configured in the Web site:


MapOrg


CrmAuthentication


For a custom ASP .Net application to work,
either:


Add
microsoft.crm.webservices.dll to the Global
Assembly Cache.


Remove the HttpModules from the custom
application.

4

of 10

Lesson: Authentication in C
ustom ASP .Net Applications


Active Directory Authentication


Use standard ASP .Net impersonation


Forms Authentication


Use the CrmImpersonator class to extract the correct
CrmAuthenticationToken class


This will ensure the CrmTicket property is correctly
set


Passport Authentication


Only available on Windows Online, which does not
support custom ASP .Net applications


Authentication on the client for offline access


Always uses Active Directory authentication

5

of 10

Authentication in C
ustom ASP .Net Applications

Using the CrmImpersonator class


C#


using (new CrmImpersonator())


{


CrmAuthenticationToken token =
CrmAuthenticationToken.ExtractCrmAuthenticationTok
en(Context, orgname);


CrmService service = new CrmService();


service.CrmAuthenticationTokenValue = token;


service.Credentials =
CredentialCache.DefaultCredentials;


}


6

of 10

Lesson: Deploying Custom ASP .Net Applications


Separate Web content pages from compiled
assemblies


Deployment location for content pages


ISV
\
<CompanyName>
\
<ApplicationName>


Deployment location for assemblies


Global Assembly Cache


Subdirectory of content page deployment location

7

of 10

Lab 9.1


Creating and Deploying an ASP .Net Application


Create a file
-
based Web site.


Add CRM SDK references.


Create new page.


Build and deploy the assembly.


Test the application.

8

of 10

Review


Configuring custom ASP .Net applications that
run within the Microsoft Dynamics CRM Web
site


Authentication and impersonation mechanisms
within a custom ASP .Net application


Deploying a custom ASP .Net application within
the Microsoft Dynamics CRM Web site

9

of 10


Test Your Knowledge


Perform the Test Your
Knowledge quiz.

10

of 10