2009-11-11 49 views
0

我是使用红宝石的新手,我想实现bort模板附带的openid功能。我在注册时使用了google openid url https://www.google.com/accounts/o8/id,但它无法获得我在openid登录中使用的电子邮件。OpenId + Bort + google

这里是我的代码的一部分,它是从BORT模板的标准代码:

def create 
logout_keeping_session! 
if using_open_id? 
    authenticate_with_open_id(params[:openid_url], :return_to => open_id_create_url, 
    :required => [:nickname, :email]) do |result, identity_url, registration| 
    if result.successful? 
     create_new_user(:identity_url => identity_url, :login => registration['nickname'], :email => registration['email']) 
    else 
     failed_creation(result.message || "Sorry, something went wrong") 
    end 
    end 
else 
    create_new_user(params[:user]) 
end 
end 

我会很感激有这方面的帮助,我一直在坚持这几天了。

感谢

回答