Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

devise_rpx_connectable

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devise_rpx_connectable

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

h1. Devise RPX Connectable

Devise << RPX by "Nicolas Blanco":http://github.com/slainer68

h2. What is Devise?

A great authentication gem for Rails applications.

"http://github.com/plataformatec/devise":http://github.com/plataformatec/devise

h2. What is RPX (now Janrain Engage)?

RPX (now called Janrain Engage) is a Software as a Service (SaaS) that helps you manage multiple authentication methods (FacebookConnect, Google, Twitter, OpenID, MySpace...) using a single API. It also provides a multilingual connection widget. Instead of managing multiple authentication providers and APIs, you just need to handle one.

Janrain Engage provides free and paid accounts.

See "Janrain Engage official homepage":https://rpxnow.com/. If you want to see what it looks like, you may signup on the Janrain Engage website as it uses Engage for signup :).

h2. What is Devise RPX Connectable?

Devise RPX Connectable is a gem to integrate Janrain Engage authentication in a Rails application using Devise.

Please note that this is an unofficial library. It is neither affiliated with, nor endorsed by Janrain Inc.

h2. Dependencies

Devise RPX Connectable should be compatible with the latest Rails and Devise versions (currently Rails 3.0+ and Devise 2.1.2+).

IMPORTANT : This gem is now ONLY COMPATIBLE with Rails 3, if you want to use it with Rails 2, please use version 0.1.3.

h2. Installation

As usual... Add @gem "devise_rpx_connectable"@ in your Gemfile...

h2. Setup

Devise: Setup

See "Devise":http://github.com/plataformatec/devise documentation for instructions on how to setup Devise.

Devise: Model

Add @:rpx_connectable@ in your Devise model (ie. User.rb)

  devise ..., :rpx_connectable

Devise:Setup

In the Devise initializer (may be @config/initializers/devise.rb@) :

  Devise.setup do |config|
    ...
    config.rpx_application_name = "mytestingapp" # The name of your RPX application (this is the name, NOT the API key!)
  end

RPXNow:API Key

In @config/application.rb@ or @config/environments/YOUR_ENV.rb@ (to set a different key for each environment...) :

  ...
    RPXNow.api_key = "aaaabbbbbccccdddddeeeeefffff"
  ...

Migrations

Your model needs one attribute/column to store the RPX identifier. By default, this identifier is @rpx_identifier@. So don't forget to add that field to your model (using a migration or whatever...).

Views

The RPX connection widget can be added in your application using a link or an iframe. If you choose to use a link, the connection widget can be displayed in a new page (standard link) or using Javascript in overlay.

I added an easy to use helper to add a link to the RPX connection popup.

  <%= link_to_rpx "Signin using RPX!", user_session_url %>

If you use the link alone, users will be redirected to a new page. If you want the more sexy popup in overlay, you need to add the JS code before the @@ of your layout. An helper is also included for this task :

      ...
      <%= javascript_include_rpx(user_session_url) %>
    
  

If you want to display the connection widget in an iframe inside a page :

  <%= embed_rpx user_session_url %>

h2. Advanced

There is some advanced features that you may use...

Devise:Setup

  Devise.setup do |config|
    ...
		config.rpx_auto_create_account = true # false if you don't want to create users automaticaly. True by default.
		config.rpx_additional_user_data = [:verifiedEmail, :url, :providerName,:photo] # default [], get some extra profile info from RPXnow, default only a few fields are available in the rpx_user object (https://rpxnow.com/docs#profile_data)
		config.rpx_extended_user_data = true # false by default, extended data only available for Plus and Pro RPX users (https://rpxnow.com/docs#api_auth_info)
  end

Devise:Model

There are two hooks that you may define in your model : @before_rpx_success@ (called before each successful connection) and @before_rpx_auto_create@ (called only once before the auto saving of the user instance, when rpx_auto_create_account is enabled). You get in parameter the RPX User object from the RPXNow gem which is basically a Hash containing more or less information depending on your RPX configuration and account. Read the RPXNow gem documentation for more information about this...

  def before_rpx_success(rpx_user)
    # Do something with rpx_user...
  end

  def before_rpx_auto_create(rpx_user)
    # Do something with rpx_user
  end

h2. TODO

  • Handle RPX multiple accounts mapping?

h2. Contributors

h2. Thanks

The base of this gem was heavily inspired from the "Devise Facebook Connectable gem":http://github.com/grimen/devise_facebook_connectable by "Jonas Grimfelt":http://github.com/grimen and other Devise gems. This gem also uses the great "rpx_now":http://github.com/grosser/rpx_now by "Michael Grosser":http://github.com/grosser

h2. License

Released under the MIT license.
Copyright (c) 2010 "Nicolas Blanco":http://github.com/slainer68

FAQs

Package last updated on 25 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc