Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Extension of the Authlogic library to add Renren Connect support built upon the renren plugin

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb
README.rdoc

Install and use

1. Install the renren plugin and make Rails use it

$ script/plugin install git://github.com/taweili/renren.git

Run the renren generator to create the cross domain scripting bridge to make it possible for your application to communicate with renren and make sure that you have setup your config/renren.yml to match your renren application

$ script/generate renren

For more information on the renren plugin checkout it's readme github.com/taweili/renren

2. Install the Authlogic Renren Connect plugin

$ script/plugin install git://github.com/flyerhzm/authlogic_renren_connect.git

3. Make some changes to your database

class AddRenrenConnectFieldsToUsers < ActiveRecord::Migration
  def self.up
    add_column :users, :renren_uid, :integer
    add_column :users, :renren_session_key, :string
  end

  def self.down
    remove_column :users, :renren_session_key
    remove_column :users, :renren_uid
  end
end

4. Import renren customized tag

<%= xn_connect_javascript_tag %>

5. Add the Renren Connect button to your login form

<%= authlogic_renren_login_button %>
<%= init_xn_connect %>

Notes

If you want to save some user data when connecting to renren you can use the before_connect hook in your user model.

def before_connect(renren_session)
  self.login = renren_session.user.name
  self.active = true
end

For more information about what you can get form the renren_session checkout the renren plugin rdoc.

Something went wrong with that request. Please try again.