Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Another Authlogic Vkontakte

tag: v0.1.2

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 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 aavkontakte.gemspec
Octocat-spinner-32 init.rb * clean shoulda dependencies May 20, 2011
README.rdoc

aavkontakte

This is beta version of aavkontakte - another authlogic vkontakte authorization gem. It provides vkontakte authorization to authlogic. This gem is tested with authlogic and authlogic-rpx on my project. Please report me about bugs. Vkontakte uses domain protection for url address of your site. But I noticed that: your-really-domain:3000/ after closing popup window is works too. You must add your domain in /etc/hosts

Install

gem install aavkontakte

  • Environment

In environment.rb:

config.gem 'aavkontakte'
  • User model

Add following line:

acts_as_authentic do |c|
  c.vkontakte_enabled = { :vk_app_id => "id", :vk_app_password => "password" }
end
  • Migrations

Create migration “script/generate migration add_vkontakte_id_to_user vk_id:string”:

class AddVkontakteIdToUser < ActiveRecord::Migration
  def self.up
    add_column :users, :vk_id, :string
    # Wait a little time for some options for this.
    # Now you are using only auto-registration, you must remove any database constraints for fields:
    # Uncomment follow lines
    # change_column :users, :crypted_password, :string, :null => true
    # change_column :users, :password_salt, :string, :null => true
    # change_column :users, :login, :string, :null => true
  end

  def self.down
    remove_column :users, :vk_id
    # Uncomment follow lines
    # change_column :users, :crypted_password, :string, :null => false
    # change_column :users, :password_salt, :string, :null => false
    # change_column :users, :login, :string, :null => false
  end
end
  • Layout

In the body section:

<%= init_vkontakte %>
  • Javascripts

After first start your application, it's copying vkontakte.js to your javascripts directory or if it doesn't exist.

  • Link

Put link somewhere, where you want:

<%= vkontakte_login_link_to "Login with vkontakte" %>

By default it uses action create of user_sessions controller. Parameters are identical link_to without block.

Contributing to aavkontakte

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet

  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright © 2011 Dmitry Vorotilin. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.