如何将Facbook登录集成到Azure Web App中

问题描述 投票:0回答:1

我正在尝试将Azure Web App连接到Facebook登录。第一步,我使用Microsoft(https://docs.microsoft.com/de-de/azure/app-service/app-service-web-tutorial-dotnet-sqldatabase)的ASP.NET MVC示例。在所有选项卡上部署后,该应用程序已启动并正在运行。

enter image description here

现在,我通过Azure中的Web应用程序设置配置身份验证。我已经通过我的Facebook开发者帐户创建了一个应用程序。

我的OAuth重定向URL是:https://.azurewebsites.net/.auth/login/facebook/callback

enter image description here

下次我打开该应用程序时,将显示Facebook登录页面,并且登录有效。我只能访问应用程序中的静态标签,如带有文本内容的主页标签。但是我无法打开具有“新建”之类功能的标签。

是否有必要对代码进行更改,或者是否足以通过Azure Portal中的Web App设置更改身份验证配置?

enter image description here

asp.net-mvc azure oauth facebook-login
1个回答
0
投票

在Startup.Auth.cs中,您需要添加以下代码以确保

app.UseFacebookAuthentication(
appId: "",
appSecret: "");
© www.soinside.com 2019 - 2024. All rights reserved.