开发者

devise facebook and tweeter ,github authentication sending wrong url

开发者 https://www.devze.com 2023-01-12 11:52 出处:网络
I am doing this in config/initializer/devise.rb using rails3 rc and ruby 1.9.2rc config.warden do |manager|

I am doing this in config/initializer/devise.rb using rails3 rc and ruby 1.9.2rc

 config.warden do |manager|
   manager.oauth(:twitter) do |twitter|
    twitter.consumer_secret = "...key....."
    twitter.consumer_key  = ".....app_key......"
    twitter.options :site => 'http://twitter.com'
   end
#  manager.default_strategies(:scope => :user).unshift :twitter_oauth

Warden::OAuth.access_token_user_finder(:twitter) do |access_token|
   user = User.find_by_access_token_and_access_secret(access_token.token, access_token.secret)
   user ||= User.create(:access_token => access_token.token, :secret => access_token.secret)
   end
end

#Warden::OAuth.access_token_user_finder(:twitter) do |access_token| 
#   User.find_or_create_by(:token => access_token.token, :secret => access_token.secret).tap 
# end

  config.oauth :github, '....app_key...', '...secret........',
    :site              => 'https://github.com/',
    :authorize_path    => 'login/oauth/authorize',
    :access_token_path => 'login/oauth/access_token',
    :scope             => %w(user public_repo)

  config.oauth :facebook, '..app_key....',  '..secret........',
    :site              => 'https://graph.facebook.com',
    :authorize_path    => 'login/oauth/authorize',
    :access_token_path => 'login/oauth/access_token'

when i click on link created in sing_in form its go to face or twitter or github but show message page not foun开发者_运维百科d , or url not exist what should be the problem

0

精彩评论

暂无评论...
验证码 换一张
取 消