omniauth-qq-oauth2 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +31 -12
- data/.gitignore +0 -17
- data/Gemfile +0 -3
- data/LICENSE.txt +0 -22
- data/README.md +0 -29
- data/Rakefile +0 -1
- data/lib/omniauth-qq-oauth2.rb +0 -2
- data/lib/omniauth-qq-oauth2/version.rb +0 -5
- data/lib/omniauth/strategies/qq.rb +0 -51
- data/omniauth-qq-oauth2.gemspec +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f3a1867b05ae2bdb4bf231cd91825a0587bb652
|
4
|
+
data.tar.gz: af51988970f822a9f96fa9f034ebee4a124738e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2bf4bd875a8b5f0b889dab85085aefff4d643fc6e9bd0b2eded1967a29e5ca9229efccd980d0b77f612612b16396a2222b9038501400c5b77bf247a44720cef
|
7
|
+
data.tar.gz: 7a71342fb353241ffc2ac9b81868ad9fa7f8607d2c65a4d5a87ca5a774d218deb1005eb9342fda129c9f3894374c6ffb12675b2d7ad81d98334806ebbb71d356
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-qq-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cireate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -66,22 +66,41 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.14.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.14.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
description: OmniAuth for QQ
|
70
98
|
email:
|
71
99
|
- jacky8ts@gmail.com
|
72
100
|
executables: []
|
73
101
|
extensions: []
|
74
102
|
extra_rdoc_files: []
|
75
|
-
files:
|
76
|
-
- .gitignore
|
77
|
-
- Gemfile
|
78
|
-
- LICENSE.txt
|
79
|
-
- README.md
|
80
|
-
- Rakefile
|
81
|
-
- lib/omniauth-qq-oauth2.rb
|
82
|
-
- lib/omniauth-qq-oauth2/version.rb
|
83
|
-
- lib/omniauth/strategies/qq.rb
|
84
|
-
- omniauth-qq-oauth2.gemspec
|
103
|
+
files: []
|
85
104
|
homepage: https://github.com/yeetim/omniauth-qq-oauth2
|
86
105
|
licenses: []
|
87
106
|
metadata: {}
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 roger
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# Omniauth::Qq::Oauth2
|
2
|
-
|
3
|
-
TODO: Write a gem description
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'omniauth-qq-oauth2'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install omniauth-qq-oauth2
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
data/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
data/lib/omniauth-qq-oauth2.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'omniauth/strategies/oauth2'
|
3
|
-
module Omniauth
|
4
|
-
module Strategies
|
5
|
-
class QQ < OmniAuth::Strategies::OAuth2
|
6
|
-
option :name, "qq"
|
7
|
-
option :client_options, {
|
8
|
-
:site => 'https://graph.qq.com/oauth2.0/',
|
9
|
-
:authorize_url => '/oauth2.0/authorize',
|
10
|
-
:token_url => "/oauth2.0/token"
|
11
|
-
}
|
12
|
-
option :token_params, {
|
13
|
-
:state => 'foobar',
|
14
|
-
:parse => :query
|
15
|
-
}
|
16
|
-
uid do
|
17
|
-
@uid ||= begin
|
18
|
-
access_token.options[:mode] = :query
|
19
|
-
access_token.options[:param_name] = :access_token
|
20
|
-
response = access_token.get('/oauth2.0/me')
|
21
|
-
matched = response.body.match(/"openid":"(?<openid>\w+)"/)
|
22
|
-
matched[:openid]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
info do
|
26
|
-
{
|
27
|
-
:nickname => raw_info['nickname'],
|
28
|
-
:name => raw_info['nickname'],
|
29
|
-
:image => raw_info['figureurl_1'],
|
30
|
-
}
|
31
|
-
end
|
32
|
-
extra do
|
33
|
-
{
|
34
|
-
:raw_info => raw_info
|
35
|
-
}
|
36
|
-
end
|
37
|
-
|
38
|
-
def raw_info
|
39
|
-
@raw_info ||= begin
|
40
|
-
client.request(:get, "https://graph.qq.com/user/get_user_info", :params => {
|
41
|
-
:format => :json,
|
42
|
-
:openid => uid,
|
43
|
-
:oauth_consumer_key => options[:client_id],
|
44
|
-
:access_token => access_token.token
|
45
|
-
}, :parse => :json).parsed
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
OmniAuth.config.add_camelization('qq', 'QQ')
|
data/omniauth-qq-oauth2.gemspec
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
require File.expand_path('../lib/omniauth-qq-oauth2/version', __FILE__)
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = "omniauth-qq-oauth2"
|
5
|
-
spec.version = Omniauth::Qq::VERSION
|
6
|
-
spec.authors = ["Cireate"]
|
7
|
-
spec.email = ["jacky8ts@gmail.com"]
|
8
|
-
spec.description = %q{OmniAuth for QQ}
|
9
|
-
spec.summary = %q{OmniAuth for QQ}
|
10
|
-
spec.homepage = "https://github.com/yeetim/omniauth-qq-oauth2"
|
11
|
-
|
12
|
-
spec.files = `git ls-files`.split("\n")
|
13
|
-
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
|
-
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
-
spec.require_paths = ["lib"]
|
16
|
-
|
17
|
-
spec.add_development_dependency 'omniauth', '~> 1.0'
|
18
|
-
spec.add_development_dependency 'omniauth-oauth', '~> 1.0'
|
19
|
-
spec.add_development_dependency 'omniauth-oauth2', '~> 1.0'
|
20
|
-
spec.add_development_dependency 'multi_json'
|
21
|
-
end
|