简体   繁体   中英

how do you extract information from profile using janrain engage with devise_rpx_connectable gem?

I learned about the devise_rpx_connectable 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM