c# – Facebook login throws“应用程序配置不允许给定URL:不允
我知道这个问题已经被问了很多次,但仍然似乎抛出了这个错误,我尝试了几个url地址.
我试图通过asp.net mvc应用程序使用facebook登录,如微软教程 当我在本地主机上检查它工作正常(Facebook的网站URL设置为:http:// localhost:55797 / Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL,or the domain must be a subdomain of one of the App's domains. 我的服务器的登录页面是:http://proj.ruppin.ac.il/igroup20/test1/Account/Login.aspx 我试图在我的Facebook应用设置中写下面的内容网址: *http://proj.ruppin.ac.il/ *http://proj.ruppin.ac.il/igroup20/ *http://proj.ruppin.ac.il/igroup20/test1/ *http://proj.ruppin.ac.il/igroup20/test1/Account/ *http://proj.ruppin.ac.il/igroup20/test1/Account/Login.aspx 但没有一个为我工作. 这是我的AuthConfig.cs: public static void RegisterOpenAuth() { // See http://go.microsoft.com/fwlink/?LinkId=252803 for details on setting up this ASP.NET // application to support logging in via external services. //OpenAuth.AuthenticationClients.AddTwitter( // consumerKey: "your Twitter consumer key",// consumerSecret: "your Twitter consumer secret"); OpenAuth.AuthenticationClients.AddFacebook( appId: "474928559284763",appSecret: "****"); //hidden just for this question //OpenAuth.AuthenticationClients.AddMicrosoft( // clientId: "your Microsoft account client id",// clientSecret: "your Microsoft account client secret"); //OpenAuth.AuthenticationClients.AddGoogle(); } 编辑: 那些是看起来与我相关的屏幕,但我似乎有不同的gui,不像汤米,例如这个帖子在这里: EDIT2: 我只是注意到有一个应用程序域的地方,并在那里写了“proj.ruppin.ac.il”和在网站的URL:“http://proj.ruppin.ac.il/igroup20/test1/”但仍然相同的错误 解决方法
为了搜索者的利益,我在创建网站的测试版本时也一样.
答案是进入facebook网站>应用程式>我的应用程式>设置> “高级”选项卡,并在标题为“有效OAuth重定向URI”的部分中添加本地主机地址. 注意:在测试时,xyz.azurewebsites.net域以及.com将需要相同的工作方式. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |