Ok, guys, I give up. I create Rails app and want login with facebook. I watch railscast, read a few tutorials and more then 20 questions on stackoverflow... but still i can't login with fb on my site.. so, please, help me with this problem...
Gemfile
gem 'omniauth-facebook'
gem 'koala', '~> 1.10.0rc'
config/initializers/omniauth.rb
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, Rails.application.secrets['APP_ID'], Rails.application.secrets['APP_SECRET'], { scope: 'user_about_me' }
end
index.html.slim
h2 Welcome
= link_to 'Login with Facebook', '/auth/facebook'
Facebook -> Developers -> MyApp -> Settigns
Basic:
And after 'Login with Facebook' link and confirm in popap I have error:
Given URL is not permitted by the Application configuration: One or more of the given URLs is not permitted 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.
Can somebody explain me, what's wrong with Facebook or with my hands?
UPDATE:
ok, another error:
When Valid OAuth redirect URIs
set to http://localhost:3000/auth/facebook/callback/
, FACEBOOK respond with error Given URL is not permitted by the Application configuration: One or more of the given URLs is not permitted 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.
But when Valid OAuth redirect URIs
set to http://localhost:3000/auth/facebook/callback
(without '/' at the end), I have OAuth2 error: OAuth2::Error
: {"error":{"message":"Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request","type":"OAuthException","code":100,"fbtrace_id":"EYOCCnhlcFv"}}