CRM 2013 Online : authenticate office 365 user without using XRM dll RRS feed

  • Question

  • I am trying to not use the XRM dlls coming with SDK. So my try is to use pure WCF calls to CRM Online 2013.

    Please note that I am not trying to use XRM dlls, so all methods present such as CrmConnection, OrganizationServiceProxy or DiscoveryServiceProxy are not available to me. I tried the same code in CRM 2011 in premise, it works there.

    Error details: An error occurred when verifying security for the message

    Below are my code:

    string strURI = @"https://wwwwww.crm4.dynamics.com/XRMServices/2011/Organization.svc";
    OrganizationServiceClient orgProxy = new OrganizationServiceClient();
    orgProxy.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("xxx@yyy.onmicrosoft.com", "xxxxxx");
    System.ServiceModel.EndpointAddress myEndpointAdd = new System.ServiceModel.EndpointAddress(new Uri(strURI), System.ServiceModel.EndpointIdentity.CreateDnsIdentity(""));
    orgProxy.Endpoint.Address = myEndpointAdd;
    Entity objAcc = new Entity();
    objAcc.LogicalName = "account";
    Crm.AttributeCollection _att = new Crm.AttributeCollection();
    _att.Add(new KeyValuePair<string, object>("name", "from XRM code"));
    _att.Add(new KeyValuePair<string, object>("accountnumber", "0101010"));
    objAcc.Attributes = _att;

    So is it possible to authenticate CRM 2013 online with office 365 users with pure WCF calls? Or we must have to XRM dlls?

    regards joon

    Wednesday, August 27, 2014 1:33 PM

All replies

  • Hi mate,

    any specific reason why you don't want to use the sdk?



    Wednesday, August 27, 2014 1:39 PM
  • Well, I am basically an old school guy and trying to find out a way to use only pure WCF calls (you can say self-challange to myself).

    As so far I know, WCF endpoints should be able to handle TOKEN based authentication easily. In case of the XRM dlls, well microsoft has done lots of work and improvised the standard WCF methods in their on way.

    I was trying to know, if this is a possibility to use pure WCF calls. Since the introduction of office 365 authentication, there shoudl be some way to access CRM, but maybe I am missing something here.



    Wednesday, August 27, 2014 1:56 PM