I have a rails application (4.2.0) that uses Facebook login features. The main gems are being developed (3.4.0) and omniauth-facebook (2.0.0). I registered the application on Facebook and used its test application for development. Facebook login functionality is in development.
When I try to use the facebook login function on the production server, I get an error: "The specified URL is not allowed in the application configuration: one or more of the specified URLs are not allowed in the application settings. It must match the website URL or URL canvas, or the domain must be a subdomain of one of the application domains.
Details for the parameters of the test application used in dev env are -
Settings: Basic: App Domains: 'localhost' Website: Site URL: 'http://localhost:3000' Advanced: OAuth Settings: Embedded browser OAuth Login: Yes Valid OAuth redirect URIs: "http://localhost:3000/users/auth/facebook/callback"
configuration information for the registered application used in production env is -
Settings: Basic: App Domains: 'www.mysite.co' Website: Site URL: 'http://www.mysite.co' Advanced: OAuth Settings: Embedded browser OAuth Login: Yes Valid OAuth redirect URIs: "http://www.mysite.co/users/auth/facebook/callback"
I have indicated the following in my secrets.yml
development: secret_key_base: some_secret_key facebook: app_id: test_app_id app_secret: test_app_secret production: secret_key_base: some_secret_key facebook: app_id: registered_app_id app_secret: registered_app_secret
And used creds from secrets.yml in the development initializer as
# ==> OmniAuth




The actual domain name (blackened) has no typos anywhere and is no different from where it is used.
Contains route.rb related to omniauth, as
cat config/routes.rb Rails.application.routes.draw do root 'home#index' devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
Routes below
bundle exec rake routes | grep user new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_omniauth_authorize GET|POST /users/auth/:provider(.:format) users/omniauth_callbacks#passthru {:provider=>/facebook/} user_omniauth_callback GET|POST /users/auth/:action/callback(.:format) users/omniauth_callbacks
The only omniauth code throughout the application is
$ cat app/controllers/users/omniauth_callbacks_controller.rb class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def facebook