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
- Host: GitHub
- URL: https://github.com/distroid/vkauth
- Owner: distroid
- Created: 2014-06-03T08:12:34.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-05T10:22:31.000Z (about 12 years ago)
- Last Synced: 2025-02-08T08:10:27.440Z (over 1 year ago)
- Language: Ruby
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
VkAuth
======
Auth class for login vk.com
How to use
- First create aplication on vk.com
- 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
- 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
- Save userdata in DB and login him