Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Regarding Retiring WS-Trust authentication protocol for connecting to Dataverse

(0) ShareShare
ReportReport
Posted on by 2

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.
  • sanket1828 Profile Picture
    2 on at
    Re: Regarding Retiring WS-Trust authentication protocol for connecting to Dataverse

    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.

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Regarding Retiring WS-Trust authentication protocol for connecting to Dataverse

    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 | Microsoft Docs

  • a33ik Profile Picture
    3,304 Most Valuable Professional on at
    Re: Regarding Retiring WS-Trust authentication protocol for connecting to Dataverse

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard