tags:

views:

101

answers:

0

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 found , or url not exist what should be the problem