facebookarchive / fbconsole

A micro api client for writing scripts against the Facebook Graph API.
Other
325 stars 74 forks source link

Given URL is not permitted 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 #27

Closed AmiMehta closed 9 years ago

AmiMehta commented 10 years ago

I have used the following steps to configure the facebook app: My project is in the smm/smm_app folder

  1. installed django-allauth
  2. Added the following bits to settings.py:

AUTHENTICATION_BACKENDS = (

Needed to login by username in Django admin, regardless of allauth

"django.contrib.auth.backends.ModelBackend",
# `allauth` specific authentication methods, such as login by e-mail
"allauth.account.auth_backends.AuthenticationBackend"

)

TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.request", "django.contrib.auth.context_processors.auth", "allauth.account.context_processors.account", "allauth.socialaccount.context_processors.socialaccount", )

auth and allauth settings

LOGIN_REDIRECT_URL = '/' SOCIALACCOUNT_QUERY_EMAIL = True SOCIALACCOUNT_PROVIDERS = { 'facebook': { 'SCOPE': ['email', 'publish_stream'], 'METHOD': 'js_sdk' # instead of 'oauth2' } }

And to INSTALLED_APPS, we’ll add these:

'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.facebook',

Now we have to add this to urls.py:

url(r'^accounts/', include('allauth.urls')),

And finally, we’ll create the database:

python manage.py syncdb

  1. Create and configure a Facebook app

  2. selected Web as the platform

  3. url: http://127.0.0.1:8000/

  4. Add the following parameters to the database: UPDATE django_site SET DOMAIN = '127.0.0.1:8000', name = 'SMM' WHERE id=1; INSERT INTO socialaccount_socialapp (provider, name, secret, client_id, key) VALUES ("facebook", "Facebook", "app-secret", "app-id-here", ''); INSERT INTO socialaccount_socialapp_sites (socialapp_id, site_id) VALUES (1,1);

  5. Now when I click 'Facebook', I get the sign-in page. But after putting in the credentials and clicking login, I get this message: "Given URL is not permitted 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."

Please help.

pcardune commented 9 years ago

Are you even using fbconsole? I see nothing related to fbconsole. Please reopen and add some fbconsole related stack trace.