【发布时间】:2013-03-30 10:49:31
【问题描述】:
我在我的 Rails 应用程序中使用 oauth gem。
gem 'omniauth-facebook', '1.4.0'
gem "omniauth-google-oauth2"
Facebook 客户端身份验证工作正常。我跟着,
http://railscasts.com/episodes/360-facebook-authentication
google 的客户端身份验证不起作用或我无法处理它。
我看到这个咖啡脚本负责 facebook 客户端身份验证,
jQuery ->
$('body').prepend('<div id="fb-root"></div>')
$.ajax
url: "#{window.location.protocol}//connect.facebook.net/en_US/all.js"
dataType: 'script'
cache: true
window.fbAsyncInit = ->
FB.init(appId: 145280228983243, cookie: true)
$('#sign_in').click (e) ->
e.preventDefault()
FB.login (response) ->
window.location = '/auth/facebook/callback' if response.authResponse
$('#sign_out').click (e) ->
FB.getLoginStatus (response) ->
FB.logout() if response.authResponse
true
google客户端认证应该怎么做?
我只想在用户点击“使用 google 登录”时弹出一个窗口 应该出现并询问用户 ID 和密码,在询问之前,它 应该检查用户信息是否已经在 浏览器(客户端),如果可用,不要提示输入用户 ID 和 密码,继续登录。
【问题讨论】:
标签: ruby-on-rails-3 popup coffeescript client-side