问题
I have a strange issue with a MVC 3 app running as an Azure Website. I have had issues with Azure in the past, but the new Website concept works almost perfectly, except for this:
DotNetOpenAuth.Messaging.ProtocolException: No OpenID endpoint found.
This only happens with Google, only on Azure. Running locally it works fine, running on AppHarbor it works fine, but on Azure every attempt to use Google for OpenID login will result in a server error due to that exception (tracked using Airbrake).
See for yourself, try logging in with Google on my website and if you immediately get a server error page it means DNOA is throwing up. All other login methods work fine, including Yahoo and AOL which are also OpenID.
P.S.: Don't try it too many times though, AirBrake will happily spam my email address :<
回答1:
Try adding this code to your web site before calling OpenIdRelyingParty.CreateRequest
:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
In some Azure configurations this has been shown to resolve the issue. Please let us know if this resolves your issue as well.
回答2:
I had this function in global.asax:
AreaRegistration.RegisterAllAreas();
After removing this line, all works perfectly.
I've added some areas in my app, this function was added automatically by VS2012.
来源:https://stackoverflow.com/questions/10969426/no-openid-endpoint-found-on-azure-website