This is a Rails app that demonstrates using rpx_now to add Janrain Engage (formerly RPX) to your Rails app. Janrain Engage allows your visitors to login to your website with their existing accounts on Facebook, Google, Twitter, Yahoo!, LinkedIn, Windows Live, MySpace, AOL or other networks and then gather their profile data and publish their activities from your website to multiple social networks.
- Supports Rails 2.3.8
- A user can login using a popup or embedded widget
- User data (identifier, username, email) is extracted and the user is auto-saved if valid
- A user with invalid data is redirected to fix the auto-filled data
current_user
represents the currently logged in user- You can use
before_filter :require_user
to protect restricted actions - A user requesting a restricted action is redirected to a login page with an embedded widget
- Once logged in, a user is redirected to the requested action
git clone git://github.com/hatem/janrain-engage-demo.git
cd janrain-engage-demo
- Install required gems:
rake gems:install
- Run the app and try the widget:
script/server
- Login to Janrain and create a new application
- Replace the value of
RPXNow.api_key
in/config/environment.rb
with the API Key of your Janrain application - Replace
janrain-engage-demo
inRPXNow.popup_code()
andRPXNow.embed_code()
with the name of your Janrain application - In the "Sign-in" section of your Janrain dashboard, you can choose the providers you want to be included in the widget. A wizard will guide you if a provider needs some configuration. Note: a Facebook application needs "Connect URL" which looks like this: https://janrain-engage-demo.rpxnow.com/