I want to use Microsoft.XRM.Sdk.Coreassemblies pack to communicate with Dynamics CRM on demand and on premise versions for a .net application. Till date I was using Version 8.0 assemblies and it is working fine.
But now I want to implement OAuth 2.0 for On-Demand instance of DCRM, after doing some R&D I got to know that it is possible with Microsoft.XRM.Sdk.Coreassemblies Version 9.0 with .net Framework 4.6.2 onward.
I am using basic authentication as of now with these new version of assemblies to keep my existing functionality working, but it is giving me an error
Exception: System.ServiceModel.Security.SecurityAccessDeniedException: Access is denied.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Execute(OrganizationRequest request)
at com.magicsoftware.ibolt.dynamicscrm.onpremise.DynamicsCRM2013.GetVersion
Can someone help me out to resolve this issue ?
Or Can anyone tell how to implement OAuth 2.0 with some examle ?