cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

@ben-thompson The customer is not running Claims/IFD, so no the steps have not been followed. And is not planned in the near future. (If it aint broken don't fix it, is the view at the customer)

 

When that is said, without having tried, Certificates could solve part of the problem. But the customer has a large set of Asp.net pages, passing AD credential directly to CRM. So here Certificates would not help. 

 

But thanks for feedback

Highlighted
Microsoft
Microsoft

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

@Menik1  

Async support is a bit of an odd thing for us.   Short answer is yes its something we are looking at.

No time frame at this point as there are number of challenges we need resolve. 

 

@Toftager  OnPrem is not the current focus of the updated SDK.  

As we look forward with it, we are considering adding Active Directory support. 

Currently for OnPrem, we have advised our customers to use an IFD configuration with oAuth Enabled to connect.   This alpha will connect that way.   That will allow you to use ( on full framework ) UID/PW, Cert, and Client Secret. 

 

@kevind2000 That is not accurate.  While we do have a Pipeline system to run plugins, plugins do not have anything to do with WCF itself.  Inside a Plugin you have a IOrganizationService to work with, which gives you access to the API endpoint.  Plugins are not going away and, as I said, are being heavily invested in. 

 

 @AhmadAnwar F# is not on the short list for support at this time.  However I will pass it along to the plugin runtime team. 

Highlighted
New Member

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

@MattB-MSFT Thanks for the feed back. I'll have to push for the customer to move to claims/ifd. 

 

I understand that AD Support is way down on the list, so I won't hold my breath waiting for this 😊

Highlighted
Frequent Visitor

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

Hello,

I know the package is still in alpha but one thing that is not working as of release 0.0.1.7-Alpha is the impersonation. Meaning that when you try setting CdsServiceClient.CallerId the call gets ignored and this property is always Guid.Empty. I did the test using the ClientSecret authentication and the application has been given the user_impersonation grant in AD.

 

I hope there will be a GitHub repo for this to better report issues 🙂

 

Best regards,

Betim Beja.

Highlighted
Microsoft
Microsoft

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

@BetimBeja  Could you /r me with a bit more details on what your doing please? 

We have validated that this works for both CallerID and AADObjectID' and that the server react's correctly. 

 

thanks

MattB

Highlighted
Frequent Visitor

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

Hello @MattB-MSFT 

this is the code I tried:

using Microsoft.Powerplatform.Cds.Client;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using System;

namespace CDS.Core_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            var cdsClient = new CdsServiceClient("AuthType = ClientSecret; ClientId=0de61874-fb6b-42e4-8f14-265aff952e96; RedirectUri=Authentiman://auth; Url = https://****.crm4.dynamics.com; ClientSecret=****; TokenCacheStorePath=c:\\MyTokenCache;LoginPrompt=Auto");
            if (cdsClient.IsReady)
            {
                Console.WriteLine("Hello, connected to CDS using .NET Core");
                cdsClient.CallerId = Guid.Parse("bc1809ae-552f-48d0-8f2d-75bf4f6f927b");
                Entity newAccount = new Entity("account");
                newAccount["name"] = "Test .NET Core";
                cdsClient.Create(newAccount);

                QueryExpression query = new QueryExpression("account");
                query.ColumnSet = new ColumnSet(true);
                var response = cdsClient.RetrieveMultiple(query);
                foreach (var item in response.Entities)
                {
                    Console.WriteLine($"Account: {item.GetAttributeValue<string>("name")} [{item.GetAttributeValue<EntityReference>("ownerid").Name}]");
                }
            }
            else
            {
                Console.WriteLine("Failed to connect to CDS using .NET Core :(");
            }


            Console.ReadKey();
        }
    }
}

I attached a screenshot of the incorrect behaviour.

 

Let me know if you need any more information regarding this.

 

Best regards,

Betim Beja.

Highlighted
Frequent Visitor

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

Hello again @MattB-MSFT ,

the impersonation feature seems to be working fine when using CallerAADObjectId. See the screenshot attached.

 

Best regards,

Betim Beja.

Highlighted
Frequent Visitor

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

Hello,

First thank you for the work that you have done, i have tried to connect to dynamics using ClientSecret 

string connectionstring = ConfigurationManager.ConnectionStrings["connectionVSMPAuth"].ConnectionString;
                        sp = new CdsServiceClient(connectionstring);

I get error system.ServiceModel.Security.MessageSecurityException: The HTTP request was forbidden with client authentication scheme 'Anonymous'. despite in the doc CdsServiceClient support ClientSecret and certificate authentification 

Cordially


Highlighted
Microsoft
Microsoft

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

This looks ( on the surface ) like a TLS error. 

Can you add this to your code before you try to connect?

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12 ;

 

thanks

Highlighted
Frequent Visitor

Re: Announcing the .net Core SDK for Common Data Service (CDS) - External Client Development

Hello @Tounisiano ,

I wrote about "The HTTP request was forbidden with client authentication scheme 'Anonymous'" in a LinkedIn article. Basically the problem is you have not created your application user in you dynamics instance yet. @MattB-MSFT the error message is very missleading in this case.

 

Best regards,

Betim Beja.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,636)