omniauth-zooniverse 0.0.3 → 0.0.4
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 +4 -4
- data/README.md +19 -5
- data/lib/omniauth/strategies/zooniverse.rb +10 -4
- data/lib/omniauth/zooniverse/version.rb +1 -1
- data/omniauth-zooniverse.gemspec +4 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb67d712fd698622b31601cbd634fd589762914b
|
4
|
+
data.tar.gz: b2fccc2a71cf796a2db9c4f628fc4be176a4e075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6c6c01b8fc38270fc14ce349b8dff5ab741c773bac6d2f0f27359c06ddbaa61bef252d5ca0d4bf21dd8f728df2e9d228bc38c340931575f2d00559b7f8cef4f
|
7
|
+
data.tar.gz: e895c4538e4e61f6ce4dc3df359a690215f4e71dd0ed3111bd57dc8d95b416f02ab80ec0b534aa91e17bcfe5562265be87c5af1f83ccf37dbbadaf9d4fa7c50f
|
data/README.md
CHANGED
@@ -1,24 +1,38 @@
|
|
1
1
|
# Omniauth::Zooniverse
|
2
2
|
|
3
|
-
|
3
|
+
OmniAuth oAuth strategy for the Zooniverse.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
|
9
|
+
```ruby
|
10
|
+
gem 'omniauth-zooniverse'
|
11
|
+
```
|
10
12
|
|
11
13
|
And then execute:
|
12
14
|
|
13
|
-
|
15
|
+
```shell
|
16
|
+
$ bundle install
|
17
|
+
```
|
14
18
|
|
15
19
|
Or install it yourself as:
|
16
20
|
|
17
|
-
|
21
|
+
```shell
|
22
|
+
$ gem install omniauth-zooniverse
|
23
|
+
```
|
18
24
|
|
19
25
|
## Usage
|
20
26
|
|
21
|
-
|
27
|
+
Configure the strategy in `config/initializers/omniauth.rb`:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
31
|
+
provider :zooniverse, ENV['ZOONIVERSE_APP_ID'], ENV['ZOONIVERSE_APP_SECRET']
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
Refer to the docs for more information on how to use omniauth in your app, https://github.com/intridea/omniauth#integrating-omniauth-into-your-application
|
22
36
|
|
23
37
|
## Contributing
|
24
38
|
|
@@ -12,7 +12,7 @@ module OmniAuth
|
|
12
12
|
option :client_options, {
|
13
13
|
:site => "https://panoptes.zooniverse.org",
|
14
14
|
:authorize_url => "/oauth/authorize",
|
15
|
-
:scope =>
|
15
|
+
:scope => DEFAULT_SCOPE
|
16
16
|
}
|
17
17
|
|
18
18
|
uid { raw_info["id"] }
|
@@ -36,14 +36,20 @@ module OmniAuth
|
|
36
36
|
info do
|
37
37
|
{
|
38
38
|
:email => raw_info["email"],
|
39
|
-
:name => raw_info["display_name"]
|
39
|
+
:name => raw_info["display_name"],
|
40
|
+
:zooniverse_id => raw_info["zooniverse_id"]
|
40
41
|
}
|
41
42
|
end
|
42
43
|
|
43
44
|
|
44
45
|
def raw_info
|
45
|
-
|
46
|
-
|
46
|
+
return @raw_info if @raw_info
|
47
|
+
token_response = access_token.get(
|
48
|
+
'/api/me',
|
49
|
+
headers: {'Accept' => "application/vnd.api+json; version=1"}
|
50
|
+
)
|
51
|
+
raw = JSON.parse(token_response.body)
|
52
|
+
@raw_info = raw["users"][0]
|
47
53
|
end
|
48
54
|
end
|
49
55
|
end
|
data/omniauth-zooniverse.gemspec
CHANGED
@@ -4,6 +4,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'omniauth/zooniverse/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
+
# https://github.com/intridea/omniauth-oauth2/issues/81
|
8
|
+
# 1.4.0 has a bug that prevents login
|
9
|
+
spec.add_dependency "omniauth-oauth2", "1.3.1"
|
10
|
+
|
7
11
|
spec.name = "omniauth-zooniverse"
|
8
12
|
spec.version = Omniauth::Zooniverse::VERSION
|
9
13
|
spec.authors = ["Stuart Lynn"]
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-zooniverse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Lynn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth-oauth2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.3.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.3.1
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,8 +90,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
90
|
version: '0'
|
77
91
|
requirements: []
|
78
92
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.5.0
|
80
94
|
signing_key:
|
81
95
|
specification_version: 4
|
82
96
|
summary: Provides an OAuth2.0 strategy for the zooniverse
|
83
97
|
test_files: []
|
98
|
+
has_rdoc:
|