An open API service indexing awesome lists of open source software.

https://github.com/distroid/vkauth

Auth class for vk.com
https://github.com/distroid/vkauth

Last synced: over 1 year ago
JSON representation

Auth class for vk.com

Awesome Lists containing this project

README

          

VkAuth
======

Auth class for login vk.com

How to use


  1. First create aplication on vk.com

  2. Create action login by vk.com
    def login_by_vk
    
    @options = {
    'client_id' => [your_app_client_id], # required
    'redirect_uri' => [callback_action], # required
    }
    redirect_to VkAuth.new(@options).get_auth_url
    end


  3. Create callback action
    def login_by_vk_callback
    
    @options = {
    'client_id' => [your_app_client_id], # required
    'redirect_uri' => [callback_action], # required
    'client_secret' => [your_app_client_secret], # required
    'user_fields' => "uid,first_name,last_name,screen_name", # optional
    }
    userdata = VkAuth.new(@options).get_user_data(request.GET["code"])
    end


  4. Save userdata in DB and login him