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

214 views Asked by At

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.

1

There are 1 answers

0
Plattsy On

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