“Facebook登录”引用“应用程序配置不允许给定URL:不允许一个或多个给定的URL [英] Facebook login throws "Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed

查看:163
本文介绍了“Facebook登录”引用“应用程序配置不允许给定URL:不允许一个或多个给定的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问了很多次了,但是似乎还是出现了这个错误,因为我尝试了几个url地址。



我正在做Facebook通过asp.net mvc应用程序登录,如微软教程
但仍然相同的错误

解决方案

为了搜索者的利益,在创建站点的测试版本时,我也是一样的。



答案是进入Facebook网站>应用程序>我的应用程序>设置>高级选项卡,并在有效的OAuth重定向URI部分添加本地主机地址'。



注意:在测试时,xyz.azurewebsites.net域以及.com将需要相同的工作方式。


I know this question was already asked many times, but still It seems to throw this error altough I tried several url addresses.

I'm trying to make facebook login through a asp.net mvc app like in microsoft tutorial here.

When I check it on local host it works fine (Site URL in facebook is set to: http://localhost:55797/ but when I try to check it after I upload the app to the server it gives me this error:

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.

My server's login page is: http://proj.ruppin.ac.il/igroup20/test1/Account/Login.aspx

I tried to write the following in my facebook app settings Site URL:

*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

but none of them works for me.

this is my 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();
        }

EDIT:

those are the screens that seems relevant to me, but I seem to have different gui, not like Tommy for example down here in this post:

EDIT2:

I just noticed there is a place for app domains and wrote there "proj.ruppin.ac.il" and in the web site url: "http://proj.ruppin.ac.il/igroup20/test1/" but still same error

解决方案

For the benefit of searchers, I had the same when creating a test version of a site.

The answer was to go into the facebook site > Apps > My App > Settings > 'Advanced' tab and add the localhost address in the section titled 'Valid OAuth redirect URIs'.

Note: The same style of work will be required for an xyz.azurewebsites.net domain as well as a .com when you are testing.

这篇关于“Facebook登录”引用“应用程序配置不允许给定URL:不允许一个或多个给定的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆