72

I've added facebook login to my site. However, when I click the button, I get a red box that says:

Invalid Argument

Given URL is not allowed by the Application configuration.

If I continue to login then I get:

API Error Code: 100
API Error Description: Invalid parameter
Error Message: next is not owned by the application.

Not sure exactly what the problem is. Any thoughts are appreciated.

Joe
  • 1,091
  • 1
  • 13
  • 18

6 Answers6

44

Your settings must be incorrect.

Go to http://www.facebook.com/developers/ and edit the application you're working on.

On the "website" tab, look for "Site URL". This should be set to your website's URL "http://yoursite.com/"

Note that if you're using subdomains, you'll also need to update "Site Domain" to be "yoursite.com"

marcgg
  • 65,020
  • 52
  • 178
  • 231
  • Thanks for the response! Yeah ... that's what I thought, but have this: http://www.zaboof.com/ for website's URL and this: zaboof.com for the site domain. Hmm .... Any other thoughts? – Joe Aug 31 '10 at 16:15
  • I'm wondering if I didn't set the next URL (I'm assuming this is the URL that we go to after login) correctly? – Joe Aug 31 '10 at 16:22
  • 3
    Never mind. I'm an idiot! The problem was that I was testing the login locally, so needed a localhost URL in application config settings. Thanks very much for you're help. – Joe Aug 31 '10 at 16:26
  • 1
    @joe: no problem! To test everything properly you might want to open some kind of tunnel so that facebook doesn't have to handle local URLs and possibily break because of that – marcgg Aug 31 '10 at 16:31
  • @joe: you'll need some kind of server ~ http://en.wikipedia.org/wiki/Tunneling_protocol – marcgg Sep 17 '10 at 13:20
  • @marcgg so is there no way to use a custom protocol for your facebook callback? – Nathan Schwermann Apr 24 '11 at 08:24
  • @schwiz: I think that nowadays you can set a secure URL. Not sure though. – marcgg Apr 26 '11 at 07:48
27

You can set up a developer application and set the url to localhost.com:port Make sure to map localhost.com to localhost on your hosts file

Works for me

davvilla
  • 520
  • 6
  • 12
  • 1
    very useful for testing during development – bradvido May 26 '11 at 19:20
  • 2
    Can someone please provide instructions on how to do this? I haven't been able to figure it out from the above (or from Googling). – Ryan Nov 20 '12 at 01:47
  • 3
    In your facebook app info, in "Site URL" change it to localhost.com, then in your hosts file (look here to know where your file is located: http://en.wikipedia.org/wiki/Hosts_(file)#Location_in_the_file_system) add an entry "127.0.0.1 localhost.com". That way when you access localhost.com it will go to 127.0.0.1 which is your local machine. Hope this helps! – davvilla Nov 21 '12 at 03:18
  • 1
    FYI... port is not required. In FB App Settings under "App Domains" add "local.yourdomain.com" (now needs to be a sub-set of the configured Site URL in Website platform config)... configure hosts as described here local.yourdomain.com 127.0.0.1 – pherris Mar 31 '14 at 17:29
4

Also check to see if you are missing the www in the url which was on my case

i was testing on http://www.mywebsite.com and in the facebook app i had set http://mywebsite.com

2

I was getting this problem while using a tunnel because I:

  1. had the tunnel url:port set in the FB app settings
  2. but was accessing the local server by pointing my browser to "http://localhost:3000"

once i started punching the tunnel url:port into the browser, i was good to go.

i'm using Rails and Facebooker, but might help others just the same.

whatbird
  • 1,552
  • 1
  • 14
  • 25
1

According to http://developers.facebook.com/docs/reference/dialogs/oauth/

for me worked

https://apps.facebook.com/YOUR_APP_NAMESPACE (watch fot http:// or https:// issue)

michalzuber
  • 5,079
  • 2
  • 28
  • 29
0

I kept getting this error, when using wildcard subdomains with my app. I had the site url set to: http://myapp.com and app domain also to http://myapp.com, and also the same value for the Valid OAuth redirect URIs in the advanced tab of the settings app. I tried different combinations but only setting the http://subdomain.myapp.com as the redirect value worked, of course only for that subdomain.

The solution was to empty the redirect fields, leave it blank, that worked! ;)

satmovi
  • 73
  • 1
  • 8