omniauth-odnoklassniki 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9f66d9ad84a060a92fcadee0e6240da7286488c
4
- data.tar.gz: 978167e78ec1b57e75b95dc8d0f70cb14a01b305
3
+ metadata.gz: 4c03baffda00e9a43c706b01d2f38975b2bdea08
4
+ data.tar.gz: 55a7879fdb6bfc6402dd16cdb216ee6ff2bdb20a
5
5
  SHA512:
6
- metadata.gz: 9769bbe8cac5453ce611e836b53a8f013ba070b47d880fb7751b7d0c1e06f83a870c5a2747886bafbe8cef98ca65605ca5afa6bfcf62674cf2a5999da266db0f
7
- data.tar.gz: 20fddb909a46ed2d203596512c0ed4af89601339013d582604be9aef860762b2e4413e86b29415693afe74af3d9ab97c15913ed640315bce09616a81a1df4063
6
+ metadata.gz: edd2f6bbf6fa94d3c3841d367f01fee2d103d3b38fb659e281c5a60b88fbfe2e3cbc7a5829a0a2c31a11369ba7f0d536747badedd3a54a12507096999a0e5a5d
7
+ data.tar.gz: df2e0357de395f9b89485ab6007fe1d3ff70dab7685f28ed9d114b78297166d8a5c9c52b096e85d1f23137d44540008ad0102542afb5a3f0ef301814180ef6c2
data/README.md CHANGED
@@ -1,8 +1,8 @@
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/pages/viewpage.action?pageId=12878032) Application ID and Keys
5
- on the [Odnoklassniki Developers Page](http://dev.odnoklassniki.ru/wiki/pages/viewpage.action?pageId=13992188).
4
+ To use it, you'll need to sign up for an [OAuth2](http://www.odnoklassniki.ru/devaccess) Application ID and Keys
5
+ on the [Odnoklassniki Developers Page](http://apiok.ru/wiki/pages/viewpage.action?pageId=42476652).
6
6
 
7
7
  ## Basic Usage
8
8
 
@@ -15,7 +15,7 @@ end
15
15
  ## Configuring
16
16
  You can configure several options, which you pass in to the `provider` method via a `Hash`:
17
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)
18
+ * `scope`: A list of permissions you want to request from the user. [Read the Odnoklassniki docs for more details](http://apiok.ru/wiki/pages/viewpage.action?pageId=42476652)
19
19
 
20
20
  For example, to get `VALUABLE_ACCESS` permissions:
21
21
 
@@ -26,6 +26,41 @@ use OmniAuth::Builder do
26
26
  end
27
27
  ```
28
28
 
29
+ ## Authentication Hash
30
+ Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
31
+
32
+ ```ruby
33
+ {"provider"=>"odnoklassniki",
34
+ "uid"=>"156210383106",
35
+ "info"=>
36
+ {"name"=>"Тимур Козьменко",
37
+ "first_name"=>"Тимур",
38
+ "last_name"=>"Козьменко",
39
+ "image"=>"http://i500.mycdn.me/getImage?photoId=182400752898&photoType=4&viewToken=NdMoSjCY43Do55GMC9dcSw",
40
+ "urls"=>{"Odnoklassniki"=>"http://www.odnoklassniki.ru/profile/156210383106"}},
41
+ "credentials"=>
42
+ {"token"=>"7.ipa228300y1o3o2ms683k5tsrvk16364", "refresh_token"=>"093ef4a51932db6e22834fb83eab95fdb83_156210383106_141603572", "expires_at"=>1416037593, "expires"=>true},
43
+ "extra"=>
44
+ {"raw_info"=>
45
+ {"uid"=>"156210383106",
46
+ "birthday"=>"1989-01-18",
47
+ "age"=>25,
48
+ "first_name"=>"Тимур",
49
+ "last_name"=>"Козьменко",
50
+ "name"=>"Тимур Козьменко",
51
+ "locale"=>"ru",
52
+ "gender"=>"male",
53
+ "has_email"=>true,
54
+ "location"=>{"city"=>"Владивосток", "country"=>"RUSSIAN_FEDERATION", "countryCode"=>"RU", "countryName"=>"Россия"},
55
+ "current_status"=>"test test",
56
+ "current_status_id"=>"527194803202",
57
+ "current_status_date"=>"1970-01-01 03:00:00",
58
+ "online"=>"web",
59
+ "photo_id"=>"182400752898",
60
+ "pic_1"=>"http://i500.mycdn.me/getImage?photoId=182400752898&photoType=4&viewToken=NdMoSjCY43Do55GMC9dcSw",
61
+ "pic_2"=>"http://usd1.mycdn.me/getImage?photoId=182400752898&photoType=2&viewToken=NdMoSjCY43Do55GMC9dcSw"}}}
62
+ ```
63
+
29
64
  ## License
30
65
 
31
66
  Copyright (c) 2011 Alexander Logvinov.
@@ -66,6 +66,7 @@ module OmniAuth
66
66
  'method' => 'users.getCurrentUser',
67
67
  'application_key' => options.public_key
68
68
  }
69
+ params['fields'] = options[:info_fields] if options.key?(:info_fields)
69
70
  params['sig'] = calculate_signature(params)
70
71
  result = access_token.get('http://api.odnoklassniki.ru/fb.do', :params => params).parsed
71
72
  raise CallbackError.new(nil, :invalid_response) if result['error_code'] || result['error_msg']
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Odnoklassniki
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-odnoklassniki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Logvinov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-03 00:00:00.000000000 Z
11
+ date: 2015-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  description: OmniAuth strategy for Odnoklassniki.ru
@@ -45,7 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
48
+ - ".gitignore"
49
49
  - Gemfile
50
50
  - README.md
51
51
  - Rakefile
@@ -62,18 +62,19 @@ require_paths:
62
62
  - lib
63
63
  required_ruby_version: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - '>='
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
74
  rubyforge_project: omniauth-odnoklassniki
75
- rubygems_version: 2.0.0
75
+ rubygems_version: 2.4.8
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: OmniAuth strategy for Odnoklassniki.ru
79
79
  test_files: []
80
+ has_rdoc: