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

Regarding Retiring WS-Trust authentication protocol for connecting to Dataverse

Hello ,

Hope You are doing well.
I am one of the developers working on Microsoft technologies.
I have a query about the WS-Trust authentication protocol which is going to be retired soon.
I am using below different approaches for the Dynamics CRM authentication.
 
Online Authentication
 
                var conn = new CrmServiceClient($@"AuthType=ClientSecret;url={organizationUri};ClientId={clientId};ClientSecret={clientSecret}");

                conn.OrganizationWebProxyClient.InnerChannel.OperationTimeout = new TimeSpan(0, Convert.ToInt16(ConfigurationManager.AppSettings["MDC_ServiceTimeOut"]), 0);
                return conn.OrganizationWebProxyClient != null ? conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

 
OnPremise Authentication
 
              String connstr = "authtype=Office365;Url=" + _OrganizationUri + ";Domain=" + _domain + ";Username=" + _userName + ";Password=" + _password + "";
              ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
              CrmServiceClient conn = new CrmServiceClient(connstr);
               if (conn.IsReady)
               {
                    service = conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
               }
 
So for the above, all two approaches do I need to make any changes?
Please guide me on this.
Your help would be really appreciated.
Awaiting Your positive reply.
3 REPLIES 3
a33ik
MVP

Hello,

I'm not sure why do you need proxy at all. I use the following code in my apps that works transparently for both Online and On-Prem:

 

var conn = new CrmServiceClient("Your Valid Connection String");

if (!conn.IsReady)
{
//handle the connection issue here
}

//use conn object here
cchannon
Super User
Super User

MSFT published a page on just this topic to help guide you away from WSTrust and the OrganizationServiceProxy class. I think you'll find the answers you're looking for here.

 

Use of Office365 authentication with Microsoft Dataverse (Microsoft Dataverse) - Power Apps | Micros...

This works fine. I have only concern that how We can authenticate the user which is not on cloud and having port number with the organization URI. see below example URL

"https://crm.organization.com:444/.

I am trying to to using oath type "Office365". but not getting succeeded. 

Please advice on this.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (5,069)