All Projects → mamantoha → Omniauth Vkontakte

mamantoha / Omniauth Vkontakte

Licence: mit
Vkontakte OAuth2 Strategy for OmniAuth

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Omniauth Vkontakte

Passport Vkontakte
VK.com authentication strategy for Passport and Node.js
Stars: ✭ 149 (+8.76%)
Mutual labels:  oauth2, vk, vkontakte
Assent
Multi-provider framework in Elixir
Stars: ✭ 126 (-8.03%)
Mutual labels:  oauth2, vk, vkontakte
vbio
Python модуль для написания скриптов, использующих Bots API для социальной сети Вконтакте (vk.com)
Stars: ✭ 10 (-92.7%)
Mutual labels:  vk, vkontakte
Vk To Telegram
Utility to forward posts from VK through callback API to telegram channel or chat
Stars: ✭ 24 (-82.48%)
Mutual labels:  vk, vkontakte
Nemiro.oauth.dll
Nemiro.OAuth is a class library for authorization via OAuth protocol in .NET Framework
Stars: ✭ 45 (-67.15%)
Mutual labels:  vk, vkontakte
kasthack.osp
Генератор сырых дампов пользователей VK.
Stars: ✭ 15 (-89.05%)
Mutual labels:  vk, vkontakte
vk-mini-app-boilerplate
Стартовый кит для создания сервиса на платформе VK Mini Apps с использованием React + Redux
Stars: ✭ 61 (-55.47%)
Mutual labels:  vk, vkontakte
Vk.py
Extremely-fast, easy-to-use, [not] ready for production. The asyncio based library for Python and Humans written to be efficient and reliable. [Unmaintained]
Stars: ✭ 38 (-72.26%)
Mutual labels:  vk, vkontakte
VK-Scraper
Scrapes VK user's photos
Stars: ✭ 42 (-69.34%)
Mutual labels:  vk, vkontakte
Vk Audio Token
Library that obtains VK tokens that work for VK audio API. Библиотека для получения токена VK, подходящего для Audio API.
Stars: ✭ 81 (-40.88%)
Mutual labels:  vk, vkontakte
Vkrss
Generates RSS feed of opened/closed vk.com wall or global searched opened posts. Features: post filtering (include/exclude by regexp and/or by owner type), ads skipping, automatic title generation, hash-tags extraction as RSS categories, initial author extraction, HTML formatting
Stars: ✭ 59 (-56.93%)
Mutual labels:  vk, vkontakte
Vkbot
Простой разговорный бот на PHP
Stars: ✭ 88 (-35.77%)
Mutual labels:  vk, vkontakte
vkListr
Скачивание списка Участников сообщества ВКонтакте
Stars: ✭ 14 (-89.78%)
Mutual labels:  vk, vkontakte
vkquick
Lightweight modern asynchronous framework for VK bots that can automatic build docs for your bots
Stars: ✭ 58 (-57.66%)
Mutual labels:  vk, vkontakte
VKAudioPlayer
VK Audio Player on Delphi
Stars: ✭ 16 (-88.32%)
Mutual labels:  vk, vkontakte
Vkb
Bot for vk.com competitions
Stars: ✭ 24 (-82.48%)
Mutual labels:  vk, vkontakte
Vk4xmpp
Jabber-транспорт для ВКонтакте (A jabber gateway to the VK social network)
Stars: ✭ 114 (-16.79%)
Mutual labels:  vk, vkontakte
vk-music-fs
FUSE file system for VK audios
Stars: ✭ 34 (-75.18%)
Mutual labels:  vk, vkontakte
easyvk-go
Simple way to work with VK API
Stars: ✭ 47 (-65.69%)
Mutual labels:  vk, vkontakte
Vk api
Модуль для создания скриптов для ВКонтакте | vk.com API wrapper
Stars: ✭ 1,070 (+681.02%)
Mutual labels:  vk, vkontakte

OmniAuth VKontakte

Ruby Codacy Badge Gem Version Maintainability

This is the unofficial OmniAuth strategy for authenticating to VKontakte via OAuth. To use it, you'll need to sign up for an OAuth2 Application ID and Secret on the Vkontakte Developers Page.

Installing

Add to your Gemfile:

gem 'omniauth-vkontakte'

Then bundle install

Usage

OmniAuth::Strategies::Vkontakte is simply a Rack middleware.

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :vkontakte, ENV['VK_API_ID'], ENV['VK_API_SECRET']
end

See the example Sinatra app.

Configuring

You can configure several options, which you pass in to the provider method via a Hash:

  • scope: a comma-separated list of access permissions you want to request from the user. Read the Vkontakte docs for more details
  • display: the display context to show the authentication page. Valid options include page, popup and mobile.
  • lang: specifies the language. Optional options include ru, ua, be, en, es, fi, de, it.
  • image_size: defines the size of the user's image. Valid options include mini(50x50), bigger(100x100), bigger_x2(200x200), original(200x*) and original_x2(400x*). Default is mini.
  • info_fields: specify which fields should be added to AuthHash when getting the user's info. Value should be a comma-separated string as per http://vk.com/dev/fields.
  • redirect_url: URL where code will be passed. This URL shall be a part of the domain specified in application settings http://vk.com/dev/auth_sites.
  • https: 1 - allows you to receive https links to photos and other media. 0 - return an http links (the default).

Here's an example of a possible configuration:

use OmniAuth::Builder do
  provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET'],
           scope: 'friends,audio,photos',
           display: 'popup',
           lang: 'en',
           https: 1,
           image_size: 'original'
end

Authentication Hash

Here's an example Auth Hash available in request.env['omniauth.auth']:

{"provider"=>"vkontakte",
 "uid"=>"1",
 "info"=>
  {"name"=>"Павел Дуров",
   "nickname"=>"",
   "first_name"=>"Павел",
   "last_name"=>"Дуров",
   "image"=>"http://cs7001.vk.me/c7003/v7003079/374b/53lwetwOxD8.jpg",
   "location"=>"Росiя, Санкт-Петербург",
   "urls"=>{"Vkontakte"=>"http://vk.com/durov"}},
 "credentials"=>
  {"token"=>
    "187041a618229fdaf16613e96e1caabc1e86e46bbfad228de41520e63fe45873684c365a14417289599f3",
   "expires_at"=>1381826003,
   "expires"=>true},
 "extra"=>
  {"raw_info"=>
    {"id"=>1,
     "first_name"=>"Павел",
     "last_name"=>"Дуров",
     "sex"=>2,
     "nickname"=>"",
     "screen_name"=>"durov",
     "bdate"=>"10.10.1984",
     "city"=>{"id"=>2, "title"=>"Санкт-Петербург"},
     "country"=>{"id"=>1, "title"=>"Росiя"},
     "photo"=>"http://cs7001.vk.me/c7003/v7003079/374b/53lwetwOxD8.jpg",
     "photo_big"=>"http://cs7001.vk.me/c7003/v7003736/3a08/mEqSflTauxA.jpg",
     "online"=>1,
     "online_app"=>"3140623",
     "online_mobile"=>1}}}

The precise information available may depend on the permissions which you request.

Supported Rubies

Tested with the following Ruby versions:

  • Ruby MRI (2.5.0+)
  • JRuby (9.2.0+)

Contributing to omniauth-vkontakte

  • Fork, fix, then send me a pull request.

License

Copyright: 2011-2021 Anton Maminov ([email protected])

This library is distributed under the MIT license. Please see the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].