简体   繁体   中英

Authentication call from secure web app to WCF data service hangs

Overview of the architecture (unfortunately I am not able to change this in any regard):

  • .net mvc site that requires authentication, lives on "Machine A"
  • wcf data service that handles authentication against an "authentication file", lives on "Machine B"

I created a custom principal (inheriting IPrincipal) and custom authorize attribute (inheriting AuthorizeAttribute) to do a couple of unique checks required of this system (similar to checking for roles). Every public controller action, with the exception of those in the "LoginController", have my custom Authorize attribute.

In my controller action to handle login request, which has the "AllowAnonymous" attribute, I post a request to the data service on Machine B and it just hangs. I've debugged the service and I can see that it receives the requests, does its work, and sends a response. The site on Machine A doesn't appear to receive the response.

Here is what I have tried to do so far:

  • I created a little app on Machine C to post the same data to the data service, the process runs to completion and the app on Machine C receives a response.
  • I have rolled back to a revision that doesn't contain any of the authentication restrictions, tried posting the same data, still no response received.
  • I have disabled all the security software I am able to on Machine A to see if the response was being captured by firewall or something, no luck.
  • If I simulate authentication then other calls to the data service for non-authentication data from the site receive responses and behave as expected.

So if you have any suggestions of other things to try, or if you would like more detail (I unfortunately cannot share code) I will do my best to provide it.

Thanks

The issue here was that there were nested async calls. When i move the async call to the data service out of the async method that was calling it it works just fine.

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