Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
Has anyone gotten the Method DiscoverAuthority from the following sample to work with ADFS?
I keep getting this error: Invalid authenticate header format
I presume is because the response.headers["WWW-Authenticate"] contains ",Negotiate,NTLM" and thus the cast Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationParameters. CreateFromResponseAuthenticateHeader((response.Headers)["WWW-Authenticate"]); returns null
I got it to work by hardocding the oauth URL to https://[adfsurl]/adfs/ls instead of https://<serverFQDNaddress>/adfs/ls/XRMServices/2011/Organization.svc/web as the sample explains.
any insights would be great.
Forgot the link to the sample
"..the following sample.." Which one are you referring to? This one msdn.microsoft.com/.../dn481599.aspx ?
The sample is quite old and needs to be updated. For example, it uses the preview ADAL NuGet package instead of the latest. There have been some ADAL API changes in the latest packages so the sample update is not simply to install the latest package. I have added the update as an action item for me.
The OAuth URL is wrong in the SDK topic and will be fixed in the next release.
Try this one liner instead of calling the DiscoverAuthority method:
AuthenticationParameters parameters = await AuthenticationParameters.CreateFromResourceUrlAsync(serviceUrl);
string _oauthUrl = parameters.Authority;
Let me know if this works for you.
Peter Hecke | Microsoft CRM SDK team
I changed my code to use the sample you provided below and it worked for a while running my code from the VS debugger and now if only works when I run the app deployed on tablets if I run it from VS I get the following error
Unauthorized Http Status Code (401) was expected in the response
I tried uninstalling and reinstalling ADFS. Repairing CRM and I still get that error any ideas?
If anyone has this issue make sure that the capabilities of the app are internetclient and that the enable loopback is set on the debugger.
Unfortunately, I have not seen this happen. When you try to call a web method, if the correct access token in the Authorization header is not supplied, you will get a 401 response, which is expected. From that response you parse the Authority URL. This is the normal flow. Make sure you are adding the SdkClientVersion parameter to your request URL. See msdn.microsoft.com/.../dn531009.aspx.
Business Applications communities