开发者

Windows azure development fabric load balancer crashes on DotNetOpenAuth redirect action mvc 2

开发者 https://www.devze.com 2023-01-10 18:36 出处:网络
I have cornered this error down to a redirect action call by DotNetOpenAuth(http://www.dotnetopenauth.net/)

I have cornered this error down to a redirect action call by DotNetOpenAuth(http://www.dotnetopenauth.net/)

Basic开发者_C百科ally I have implemented the example here

http://www.dotnetopenauth.net/developers/code-snippets/programmatic-openid-relying-party/

In my application while running locally I hit this line

return request.RedirectingResponse.AsActionResult();

At this point it completes this action and then the azure dev fabric load balancer crashes.

Here is where it gets strange. If I debug line by line into the redirect action it will not crash.

Has anyone seen anything like this that can give me some direction on a fix?

@dthorpe points out that I should tell you all I have tested this by deploying to the production environment and this does seem to work.


We had same problem. There is no fix I currently know of and application still works fine, while deployed in the cloud.

Yet for the local testing purposes I merely introduced switch (it could be compile-time ifdef DEBUG or configuration switch). Whenever there is attempt to authenticate via the OpenID in local dev fabric, we immediately assume the identity is valid and authenticated by the DotNetOpenAuth. This worked for us and allowed to move the development forward.


I have a fix. It's a slight hack, but it does work and you don't have to fake anything.

Change this:

return request.RedirectingResponse.AsActionResult();

to this:

string location = request.RedirectingResponse.Headers["Location"];
return Redirect(location);

This gets around the issue and allows authentication to proceed. I'll allow someone brighter than myself to give a detailed explanation as to why this is the case.

Hope this helps!


If anyone's looking for a quick fix for this, one option is to turn off Azure diagnostics, if you happen to not be using it. This is added to the web.config when you create your project, just comment out the "add" element as shown and you're done.

<system.diagnostics>
  <trace>
    <listeners>
      <!--<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
        <filter type="" />
      </add>-->
    </listeners>
</trace>

Of course this turns off diagnostics so only do it if you're not using diagnostics!

0

精彩评论

暂无评论...
验证码 换一张
取 消