简体   繁体   English

部署到Azure后OAuth无法正常工作[ASP.NET MVC]

[英]OAuth not working after deploying to Azure [ASP.NET MVC]

I'm trying to integrate OAuth in my Web App . 我正在尝试将OAuth集成到我的Web App中 It's working fine when testing it through localhost. 通过localhost测试它时工作正常。 But after publishing to Azure its not working. 但在发布到Azure后它无法正常工作。 Getting Http 500 error for http://shibpurconnect.azurewebsites.net/Account/ExternalLoginCallback http://shibpurconnect.azurewebsites.net/Account/ExternalLoginCallback出现Http 500错误

I have already updated all the redirect urls in Google, Facebok. 我已经更新了Google,Facebok中的所有重定向网址。 Please see attached screenshot - 请参阅随附的截图 - 在此输入图像描述在此输入图像描述

Looks like I'm missing some configuration, but not sure what. 看起来我错过了一些配置,但不确定是什么。

Thanks for looking into it and appreciate your help. 感谢您查看并感谢您的帮助。

500 is internal server error. 500是内部服务器错误。 So something went wrong in the function ExternalLoginCallback when it was executed on the server. 因此在服务器上执行ExternalLoginCallback函数时出现问题。 What I do is create a simple error Controller, then I could put a try / catch around the code in AccountController.cs -> ExternalLoginCallback and redirect to ErrorController from inside the catch. 我做的是创建一个简单的错误控制器,然后我可以在AccountController.cs - > ExternalLoginCallback中的代码周围放置一个try / catch,并从catch内部重定向到ErrorController。 after I log & display the error from the ErrorController. 在我记录并显示ErrorController中的错误之后。

I integrated Elmah and able to get the actual reason. 我整合了Elmah并且能够得到实际的原因。 It was due to login failure to database. 这是由于登录数据库失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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