omniauth-vkontakte 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/examples/sinatra.rb +1 -1
- data/lib/omniauth-vkontakte/version.rb +1 -1
- data/lib/omniauth/strategies/vkontakte.rb +14 -4
- metadata +9 -9
data/README.md
CHANGED
@@ -7,7 +7,7 @@ on the [Vkontakte Developers Page](http://vk.com/developers.php).
|
|
7
7
|
## Basic Usage
|
8
8
|
|
9
9
|
use OmniAuth::Builder do
|
10
|
-
provider :vkontakte, ENV['API_KEY'], ENV['API_SECRET']
|
10
|
+
provider :vkontakte, ENV['API_KEY'], ENV['API_SECRET'], :scope => 'friends,audio', :display => 'popup'
|
11
11
|
end
|
12
12
|
|
13
13
|
## Ruby
|
@@ -19,7 +19,7 @@ Tested with the following Ruby versions:
|
|
19
19
|
|
20
20
|
## License
|
21
21
|
|
22
|
-
Copyright (c) 2011 Anton Maminov.
|
22
|
+
Copyright (c) 2011, 2012 Anton Maminov.
|
23
23
|
|
24
24
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
25
25
|
|
data/examples/sinatra.rb
CHANGED
@@ -11,7 +11,7 @@ SCOPE = 'friends,audio'
|
|
11
11
|
use Rack::Session::Cookie
|
12
12
|
|
13
13
|
use OmniAuth::Builder do
|
14
|
-
provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET'], :scope => SCOPE
|
14
|
+
provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET'], :scope => SCOPE, :display => 'popup'
|
15
15
|
end
|
16
16
|
|
17
17
|
get '/' do
|
@@ -11,10 +11,10 @@ module OmniAuth
|
|
11
11
|
# @example Basic Usage
|
12
12
|
# use OmniAuth::Strategies::Vkontakte, 'API Key', 'Secret Key'
|
13
13
|
class Vkontakte < OmniAuth::Strategies::OAuth2
|
14
|
-
DEFAULT_SCOPE = ''
|
15
|
-
|
14
|
+
DEFAULT_SCOPE = 'friends,audio'
|
15
|
+
|
16
16
|
option :name, 'vkontakte'
|
17
|
-
|
17
|
+
|
18
18
|
option :client_options, {
|
19
19
|
:site => 'https://api.vk.com/',
|
20
20
|
:token_url => '/oauth/token',
|
@@ -25,8 +25,10 @@ module OmniAuth
|
|
25
25
|
:param_name => 'access_token',
|
26
26
|
}
|
27
27
|
|
28
|
+
option :authorize_options, [:scope, :display]
|
29
|
+
|
28
30
|
uid { access_token.params['user_id'] }
|
29
|
-
|
31
|
+
|
30
32
|
# https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema
|
31
33
|
info do
|
32
34
|
{
|
@@ -52,8 +54,16 @@ module OmniAuth
|
|
52
54
|
@raw_info ||= access_token.get('/method/getProfiles', :params => { :uid => uid, :fields => fields.join(',') }).parsed["response"].first
|
53
55
|
end
|
54
56
|
|
57
|
+
##
|
58
|
+
# You can pass +display+or +scope+ params to the auth request, if
|
59
|
+
# you need to set them dynamically.
|
60
|
+
#
|
61
|
+
# /auth/vkontakte?display=popup
|
62
|
+
#
|
55
63
|
def authorize_params
|
56
64
|
super.tap do |params|
|
65
|
+
params.merge!(:display => request.params['display']) if request.params['display']
|
66
|
+
params.merge!(:scope => request.params['scope']) if request.params['scope']
|
57
67
|
params[:scope] ||= DEFAULT_SCOPE
|
58
68
|
end
|
59
69
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-vkontakte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
|
-
requirement: &
|
16
|
+
requirement: &85957200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *85957200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: omniauth-oauth2
|
27
|
-
requirement: &
|
27
|
+
requirement: &85956390 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *85956390
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: multi_json
|
38
|
-
requirement: &
|
38
|
+
requirement: &85956070 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *85956070
|
47
47
|
description: Unofficial VKontakte strategy for OmniAuth 1.0
|
48
48
|
email:
|
49
49
|
- anton.linux@gmail.com
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.8.
|
82
|
+
rubygems_version: 1.8.10
|
83
83
|
signing_key:
|
84
84
|
specification_version: 3
|
85
85
|
summary: Unofficial VKontakte strategy for OmniAuth 1.0
|