2011-05-14 4 views
0

안녕하세요 이 질문은 이전에 물어 왔지만 거기에 대한 답변이 저를 위해 작동하지 않습니다.OmniAuth 유효하지 않은 응답 - 1.9.2로 업데이트되지 않음

내 사이트로 리디렉션 할 때 여전히 결과가 나타납니다.

/auth/failure?message=invalid_response 

는 I 루비 1.9.2p180 (2011-02-18 수요일 수정 30,909) x86_64에-darwin10.6.0] 설치하여 레일 3.0.7 설치 필요한 보석을 갖는다. 다른 스레드에서 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 

답변

1

나는 이것이 내 Gemfile

gem 'omniauth', '0.2.0'

버전 0.2.6 같으면에서 다음을 지정하여 작동시킬 수 있었다 나를 위해 일하지 마라. 또한 .rvmrc로 rvm use [email protected]으로 업데이트했습니다. 오, 로그인했는지 확인하십시오. 위의 코드에서 current_user이 있다고 가정합니다. Omniauth를 통한 사용자 생성을 허용하는 Ryan의 Railscast part two을 참조하십시오.

나는 demo working here이 있지만, Devise를 사용하는 대신 처음부터 인증을하고 있음을 유의하십시오.