我在config / initializer / devise.rb中使用rails3 rc和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'
当我点击以sing_in形式创建的链接时,它会转到face或者twitter或github,但显示未找到消息页面,或者url不存在应该是什么问题