简体   繁体   中英

Authenticate users with Microsoft Dynamics CRM 2011 (IFD) through code (C#)

I have internet facing Dynamics CRM 2011 deployment on Rollup 17 hosted in Azure.

The deployment was configured according to the guide provided on Microsoft website ( http://www.microsoft.com/en-us/download/details.aspx?id=41701 ).

When accessing the application the authentication through ADFS works fine and I can access it successfully.

I'm also trying to build a custom web application that will connect to the CRM. I've downloaded CRM 2011 SDK and tried to run the sample code found in \\SDK\\SampleCode\\CS\\QuickStart. However, the authentication fails with the following error:

The request channel timed out while waiting for a reply after 00:00:59.9969195. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

When going to inner exception details I can see:

The HTTP request to ' http://sts1.mydomain.com.au/adfs/services/trust/13/username ' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.

I'm trying to figure out why is it trying to access the username endpoint through HTTP. When I open port 80 on my ADFS server it woks fine and I can authenticate. However, I don't want to have port 80 open and I want all the communication to go through HTTPS!!

I've tried all the potential solutions found by Google but to no avail.

Any help will be greatly appreciated.

We've worked with Microsoft Support guys, and they replicated our environment in order to see what's going on. However, for them the authentication request was going to the usernamemixed endpoint which supposedly was the correct behavior as it uses HTTPS.

After some testing we decided to disable the username endpoint and to our surprise, the requests started to go to the usernamemixed endpoint and it's all working fine now.

So, not sure why it didn't use the usernamemixed endpoint straight away as for the MS Support guys, but after disabling the username endpoint. The only difference I can see is that they used Windows Server 2012 R2 and we are using Windows Server 2012.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM