Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Change WS-Trust security protocol to Office 365 authentication

Posted on by 384

Hello,

I got an email about "D365 Platform Modernization: Deprecate legacy authentication-WS-Trust" last week. I compared my code with the one mentioned in that email about how to determine that my code is using WS-Trust, I found that I was using the OrganizationServiceProxy class, it belongs to WS-Trust.

I found an article published in 2019 on the official website about how to use CrmServiceClient to connect to organization services. Please see the following screenshot. But I feel like the code provided in this screenshot also belongs to WS-Trust, not office 365.

I just want to make sure that the way I connect to the organization service given in the following screenshot belongs to WS-Trust, and if I want to change it based on the code in it, how do I need to modify this code to change my security protocol from WS-Trust to Office 365.

0844.png

  • malik1126 Profile Picture
    malik1126 30 on at
    RE: Change WS-Trust security protocol to Office 365 authentication

    How to use Oauth bearer token in SOAP request / SOAP Body ?

  • Jim Daly Profile Picture
    Jim Daly on at
    RE: Change WS-Trust security protocol to Office 365 authentication

    Details are here: docs.microsoft.com/.../authenticate-office365-deprecation

  • Verified answer
    Stone Huang Profile Picture
    Stone Huang 384 on at
    RE: Change WS-Trust security protocol to Office 365 authentication

    I just looked it up on the Internet. It seems that if the authentication type is oauth, there must be client id and redirect uri. I know something about client id, but this redirect uri? Its format is app://58145B91-0C36-4500-8554-080854F2AC97, I want to know what the back GUID stands for and where it came from.

    Isn't there a way of authentication type that is Oauth, and doesn't need client id and redirect uri?

  • Stone Huang Profile Picture
    Stone Huang 384 on at
    RE: Change WS-Trust security protocol to Office 365 authentication

    Thank you very much for your answer.

    I just tried what you said, changed office 365 to Oauth, but the code hit an error, show that need to provide client id and redirect id.

    Do you know what are client id and redirect id? I haven't used these two things before.

    Is there a way not to use client and redirect id and to change WS-Trust to Office 365?

    8750.jpg

  • edmunch Profile Picture
    edmunch on at
    RE: Change WS-Trust security protocol to Office 365 authentication

    David is correct , you should only need to change AuthType to Oauth.

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Change WS-Trust security protocol to Office 365 authentication

    That example is using WS-Trust. If you use AuthType=Office365 with the CrmServiceClient it will use WS-Trust. To avoid using WS-Trust, change the AuthType to OAuth. That should be all you need to change, though any references to CrmServiceClient.OrganizationServiceProxy should be changed to CrmServiceClient.IOrganizationService

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans