Facebook login throws "Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed

18,061

Solution 1

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.

Solution 2

Try this! These steps worked for my fb app hosted locally on http://localhost:3000/

Once signed in to your app on developers.facebook.com/...

  1. Click Settings > Basic
  2. Leave the "App Domains" field blank.
  3. Click + Add Platform > Website
  4. Use http://localhost:3000/ for both "Site URL" and "Mobile Site URL" fields
  5. Click Save Changes

FINALLY!

Solution 3

You will need to update your App Domains as well in the Facebook Application configuration module to proj.ruppin.ac.il (Image taken from referenced tutorial to show that there are 2 places to update when changing FB app login URL)

enter image description here

Solution 4

Here's all the things I did to get this working

  1. Nothing in "App Domains"
  2. Put the server name (with port) in "Site URL"
  3. In the "App Details" tab turn on your "Website" (I have the mobile website on) http://cl.ly/image/0h0D0L050Z2v (Why is this separate from setting the URL?)
  4. Quadruple check your appid. I swear mine changed. But maybe I'm hallucinating that.
Share:
18,061

Related videos on Youtube

Dvirski
Author by

Dvirski

Updated on September 16, 2022

Comments

  • Dvirski
    Dvirski over 1 year

    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:

    Screen1

    Screen2

    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

  • Dvirski
    Dvirski over 10 years
    Thanks, but I can't seem to find this screen in the app page in the developer's section . check my edit for how the developer's section looks to me
  • Tommy
    Tommy over 10 years
    @Dvirski - App Domains is to the left of contact email. The screenshots you pasted look completely different from the ones I am seeing. Are you at developers.facebook.com?
  • Dvirski
    Dvirski over 10 years
    yeah, this is the url I'm on: developers.facebook.com/x/apps/474928559284763/dashboard That's just weird..
  • Dvirski
    Dvirski over 10 years
    Check my second edit, noticed a place for domain, but still same error
  • Tommy
    Tommy over 10 years
    @Dvirski - have you tried setting your website to just http://proj.ruppin.ac.il/? Also, can you update/replace your screenshots with your updates that you have made based on your comments (updated app domain and website url)?
  • Murat Çorlu
    Murat Çorlu about 10 years
    If I enter "localhost" as App Domains, Facebook says "Top-level domains are not allowed".
  • Roy Lee
    Roy Lee almost 10 years
    this works like charm, it should be the answer! thanks @jlynchdotco