0
我正在使用open_id_authentication gem向Google進行身份驗證。在我的會話控制器中我撥打Rails 3.0.9 + open_id_authentication
authenticate_with_open_id(complete_identity_url, OPENID_OPTS) do |openid_result, identity_url, registration|
並且它返回401狀態碼Unauthenticated。但它應該顯示谷歌頁面,我必須確認訪問權限。
我做示例應用程序:https://github.com/mbashirov/rails3-test,它只有在會話控制和路由集代碼。
該代碼在rails 2.3應用程序中完美工作。有錯誤?
謝謝。
解決方案。
在會話控制器添加
class SessionsController < ApplicationController
include OpenIdAuthentication
在配置/ application.rb中添加
config.app_middleware.use OpenIdAuthentication
後這兩個步驟都工作正常。
感謝您的建議,它真的幫助了我。 – mbashirov