开发者

devise + omniauth auth/failure?message=invalid_credentials

开发者 https://www.devze.com 2023-03-05 12:45 出处:网络
after i added an application in twitter when i request for an authentication in twitter (/auth/twitter) i get these error message

after i added an application in twitter when i request for an authentication in twitter (/auth/twitter) i get these error message

http://localhost:3000/auth/failure?message=invalid_credentials

Routing Error

No route matches "/auth/failure"

how can i add a valid credential or is there any ssl certificate that must be included in requesting for twitter auth??

my facebook authentication just works fine after i added a parameter ssl certificate that looks like this

 Rails.application.config.middleware.use OmniAuth::Builder do
      provider :facebook,'xxx', 'xx', { :scope => 'publish_stream,offline_access,email',:client_options => { :ssl =>{ :ca_path => "/etc/s开发者_JAVA技巧sl/certs" } }}

      provider :twitter, 'xx','xxx' #,{ :client_options => { :ssl =>{ :ca_path => "/etc/ssl/certs" } }}
end


i've same problem with you, it happen because oauth_token in twitter login only valid on once request. May be your application trying to refresh when authentication to twitter.

when i've problem like you, my apps trying to refresh the webpage with

window.opener.location = "#{request.fullpath}";

Until now i'couldn't find how to popup a window when login using twitter. I'm using omniauth and rails 3.0.3. Thanks


This is all you need

site url http://localhost:3000/

0

精彩评论

暂无评论...
验证码 换一张
取 消