Random Musings

April 29, 2009

Invoke CRM Service by using a user domain credential

Filed under: Dynamics CRM — haditeo @ 9:16 pm

Developers can use the NetworkCredential’s object to impersonate a user while creating the CRM Service. The NetworkCredential’s object should be placed in the service’s object of Credentials property.

NetworkCredential nc = new NetworkCredential(userName, password, domain);

CrmAuthenticationToken token = new CrmAuthenticationToken();
token.OrganizationName = orgName;
token.AuthenticationType = 0;

CrmService service = new CrmService();
service.Credentials = nc;
service.CrmAuthenticationTokenValue = token;
service.Url = crmServiceUrl;


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: