I learned about the devise_rpx_connectabl开发者_JS百科e gem through a railscast. I've implemented with my rails 3 application and it authenticates the user fine; but I don't know how to 1) redirect after login using the urle_token, 2) use the token received from janrain to extract data.
I've read many posts on this and went through the janrain tutorial, but it mainly deals with php and not ruby/rails.
Thanks for your help.
Not sure if this is what you need but the rpx_connectable gem gives you a hook that allows you to save any data janrain retrieved into the user model:
# user.rb
def on_before_rpx_success(rpx_data)
logger.info rpx_data.inspect + "-------------------------------"
name = rpx_data["name"]
unless name.nil?
self.first_name = name["givenName"]
self.last_name = name["familyName"]
self.save
end
end
I wrote a post on it here
精彩评论