7

I have just registered hostel6.in domain name with justhost.com, and I have facebook app in /fb/hogwarts_team folder.

I am using following setting in my app settings

App Domain:         hostel6.in
Site URL:           http://hostel6.in/fb/hogwarts_team
Canvas URL:         http://hostel6.in/fb/hogwarts_team/
Secure Canvas URL:  https://secure.justhost.com/~hostelsi/fb/hogwarts_team/

When I am using the app via url

apps.facebook.com/hogwarts_team/

I am getting error

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

but when I am using app via url:

hostel6.in/fb/hogwarts_team/

everything works fine.

Apart from these settings I have used following code in fbmain.php

$fbconfig['baseUrl']    =   "http://hostel6.in/fb/hogwarts_team/" 

I have already read solutions on stackoverflow for similar question, but none have worked for me.

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
pawan
  • 401
  • 1
  • 5
  • 14

3 Answers3

8

If you are testing locally,Just add

  1. Localhost in the app domain box

  2. http://localhost:8080/ in the site url box.

This works for me!

Agus
  • 1,604
  • 2
  • 23
  • 48
user1452376
  • 129
  • 2
  • 12
  • I think your answer should have marked as Correct... it is short and solved my problem. the trick was adding (Localhost) to the domain part. THanks alot. – reaz Jul 06 '13 at 07:26
  • Very useful!! Unfortunately I don't find the Facebook documentation on these fields very useful. Or actually I just don't find them at all. =\ Thanks for the answer! – Josh Brown Jun 22 '15 at 20:02
4

Your app is immediately redirecting to the Auth dialog, with the redirect_uri parameter set to https://173.254.28.28/~hostelsi/fb/hogwarts_team/ - this doesn't match the configuration you've listed in your question.

If you're using the PHP SDK, check your call to getLoginUrl() as this is likely where the problem is, otherwise check where you're detecting the user's session and redirecting to the Oauth dialog if one doesn't exist, as this is where you're setting the redirect_uri incorrectly.

Igy
  • 43,710
  • 8
  • 89
  • 115
  • @lgy This the loginUrl generated for me.:- https://www.facebook.com/dialog/oauth?client_id=xxxxxxxxxxx&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Ftest_prophet&state=c24aca68c37d388249e941c48e0e6bfd&scope=email%2Cpublish_actions I am also getting the same API Code 191 error. – Divyanshu Das Sep 29 '13 at 10:30
0

I also faced same issue even after entering proper :
1) App Domain and
2) Site URL
I didn't set up the Contact Email in the basic app settings. After spending several hours and creating new app in fb i found this out. This might be helpful for someone who is doing same mistake like me.

Sajal
  • 1,198
  • 1
  • 17
  • 32