嗨,我知道以前有人问过这个问题,但那里的答案对我不起作用。
重定向回我的网站时,我仍然得到。
/auth/failure?message=invalid_response
我安装了 ruby 1.9.2p180(2011-02-18 修订版 30909)[x86_64-darwin10.6.0],使用 rails 3.0.7 并安装了所需的 gem。我在另一个线程上读到,您应该将 pure_json 添加到 gemfile 中以使其工作。但这对我也没有帮助。
我一无所知...在此先感谢
authenticationscontroller
def index
@authentications = current_user.authentications if current_user
end
def create
#render :text => request.env["omniauth.auth"].to_yaml
auth = request.env["omniauth.auth"]
current_user.authentications.find_or_create_by_provider_and_uid(auth['provider'], auth['uid'])
flash[:notice] = "Authentication successful."
redirect_to authentications_url
end