Class: OmniAuth::Strategies::Vkontakte

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/vkontakte.rb

Overview

Authenticate to Vkontakte utilizing OAuth 2.0 and retrieve basic user information. documentation available here: http://vkontakte.ru/developers.php?o=-17680044&p=Authorization&s=0

Examples:

Basic Usage

use OmniAuth::Strategies::Vkontakte, 'API Key', 'Secret Key'

Instance Attribute Summary

Attributes inherited from OAuth2

#client_id, #client_options, #client_secret, #options

Instance Method Summary collapse

Methods inherited from OAuth2

#callback_url, #client

Constructor Details

#initialize(app, api_key = nil, secret_key = nil, options = {}, &block) ⇒ Vkontakte

Returns a new instance of Vkontakte.

Parameters:

  • app (Rack Application)

    standard middleware application parameter

  • api_key (String) (defaults to: nil)

    the application id as [registered in Vkontakte]

  • secret_key (String) (defaults to: nil)

    the application secret as [registered in Vkontakte]



18
19
20
21
22
23
24
25
26
# File 'lib/omniauth/strategies/vkontakte.rb', line 18

def initialize(app, api_key = nil, secret_key = nil, options = {}, &block)
  client_options = {
    :site => 'https://vkontakte.ru',
    :authorize_url => 'http://api.vkontakte.ru/oauth/authorize',
    :access_token_url => 'https://api.vkontakte.ru/oauth/token'
  }

  super(app, :vkontakte, api_key, secret_key, client_options, options, &block)
end