omniauth-odnoklassniki 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5265fc02e1db4ad6182e7933bac1e5f1b1b3fb79
4
+ data.tar.gz: d55ee43208ef0617a3d891fc08d923be76baa9be
5
+ SHA512:
6
+ metadata.gz: a1eecdd83fc280ee1cb7a1b815223082acec7c2dbdc71afd8e4c18a292d69202b36cd7388ce0a3993376c64d6b0828a3506fd36613049e36c9c5e65ea2a19617
7
+ data.tar.gz: c4740a93787e54cc4fbd6168ca26f1080c20c8a9cd36a3c4a6d059ccc960f9178d6fdd5be95f52280f109aaa19c9cea76b12ba537439483a2ffb4322b2a0ff2b
data/README.md CHANGED
@@ -1,14 +1,30 @@
1
1
  # OmniAuth Odnoklassniki.ru
2
2
 
3
3
  This is the unofficial OmniAuth strategy for authenticating to Odnoklassniki.ru via OAuth.
4
- To use it, you'll need to sign up for an [OAuth2](http://dev.odnoklassniki.ru/wiki/display/ok/The+OAuth+2.0+Protocol) Application ID and Keys
4
+ To use it, you'll need to sign up for an [OAuth2](http://dev.odnoklassniki.ru/wiki/pages/viewpage.action?pageId=12878032) Application ID and Keys
5
5
  on the [Odnoklassniki Developers Page](http://dev.odnoklassniki.ru/wiki/pages/viewpage.action?pageId=13992188).
6
6
 
7
7
  ## Basic Usage
8
8
 
9
- use OmniAuth::Builder do
10
- provider :odnoklassniki, ENV['APP_ID'], ENV['APP_SECRET_KEY'], :public_key => ENV['APP_PUBLIC_KEY']
11
- end
9
+ ```ruby
10
+ use OmniAuth::Builder do
11
+ provider :odnoklassniki, ENV['APP_ID'], ENV['APP_SECRET_KEY'], :public_key => ENV['APP_PUBLIC_KEY']
12
+ end
13
+ ```
14
+
15
+ ## Configuring
16
+ You can configure several options, which you pass in to the `provider` method via a `Hash`:
17
+
18
+ * `scope`: A list of permissions you want to request from the user. [Read the Odnoklassniki docs for more details](http://dev.odnoklassniki.ru/wiki/pages/viewpage.action?pageId=12878032)
19
+
20
+ For example, to get `VALUABLE_ACCESS` permissions:
21
+
22
+ ```ruby
23
+ use OmniAuth::Builder do
24
+ provider :odnoklassniki, ENV['APP_ID'], ENV['APP_SECRET_KEY'], :public_key => ENV['APP_PUBLIC_KEY'],
25
+ :scope => 'VALUABLE_ACCESS'
26
+ end
27
+ ```
12
28
 
13
29
  ## License
14
30
 
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Odnoklassniki
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -17,6 +17,8 @@ module OmniAuth
17
17
  :param_name => 'access_token'
18
18
  }
19
19
 
20
+ option :provider_ignores_state, true
21
+
20
22
  uid do
21
23
  raw_info['uid']
22
24
  end
@@ -66,7 +68,8 @@ module OmniAuth
66
68
  @raw_info ||= begin
67
69
  params = {
68
70
  'method' => 'users.getCurrentUser',
69
- 'application_key' => options.public_key
71
+ 'application_key' => options.public_key,
72
+ 'scope' => URI::encode(options.scope)
70
73
  }
71
74
  params[:sig] = calculate_signature(params)
72
75
  access_token.get('http://api.odnoklassniki.ru/fb.do', :params => params).parsed
metadata CHANGED
@@ -1,38 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-odnoklassniki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alexander Logvinov
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-11-27 00:00:00.000000000 Z
11
+ date: 2013-04-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: omniauth
16
- requirement: &70350990646720 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70350990646720
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: omniauth-oauth2
27
- requirement: &70350990645180 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ~>
31
32
  - !ruby/object:Gem::Version
32
33
  version: '1.0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70350990645180
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
36
41
  description: OmniAuth strategy for Odnoklassniki.ru
37
42
  email:
38
43
  - avl@logvinov.com
@@ -50,27 +55,25 @@ files:
50
55
  - omniauth-odnoklassniki.gemspec
51
56
  homepage: https://github.com/incubus/omniauth-odnoklassniki
52
57
  licenses: []
58
+ metadata: {}
53
59
  post_install_message:
54
60
  rdoc_options: []
55
61
  require_paths:
56
62
  - lib
57
63
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
64
  requirements:
60
- - - ! '>='
65
+ - - '>='
61
66
  - !ruby/object:Gem::Version
62
67
  version: '0'
63
68
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
69
  requirements:
66
- - - ! '>='
70
+ - - '>='
67
71
  - !ruby/object:Gem::Version
68
72
  version: '0'
69
73
  requirements: []
70
74
  rubyforge_project: omniauth-odnoklassniki
71
- rubygems_version: 1.8.10
75
+ rubygems_version: 2.0.0
72
76
  signing_key:
73
- specification_version: 3
77
+ specification_version: 4
74
78
  summary: OmniAuth strategy for Odnoklassniki.ru
75
79
  test_files: []
76
- has_rdoc: