omniauth-orcid 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +20 -0
- data/README.md +4 -4
- data/lib/omniauth/orcid/version.rb +1 -1
- data/lib/omniauth/strategies/orcid.rb +18 -18
- data/omniauth-orcid.gemspec +7 -7
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3433775b793b7860d91b4f8e809575e1610b64ae
|
4
|
+
data.tar.gz: e8c54ca4b1ebadb64710036159bb1dccaf1a6d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a34431d0520bb7b8a7e51b26034a2eb3fc775f951ce83047c91819a075a33a7ab725f5370d0141a17d5da1f5e1f37f49e60bfefb71de2ef245352ab951be839
|
7
|
+
data.tar.gz: 5c0f534a4f938b699fe1164159770e53d340396d86e50342f6873d202784bb4d5179df4e4cc5f264097b2d0391101ed309b15db4ad6440212d9654bfe977eeb0
|
data/.gitignore
ADDED
data/README.md
CHANGED
@@ -46,7 +46,7 @@ There are three ways to register a client application and obtain client app cred
|
|
46
46
|
|
47
47
|
* for non-members (the default): Register your client application in the `Developer Tools` section of your ORCID profile. Use `https://pub.orcid.org` as `site URL`
|
48
48
|
* for members (production): Register your client application [here](http://orcid.org/content/register-client-application). Use https://api.orcid.org as `site URL`
|
49
|
-
* for development (sandbox): Register your client application [here](https://orcid.org/content/register-client-application-sandbox). Use https://sandbox.orcid.org as `site URL`
|
49
|
+
* for development (sandbox): Register your client application [here](https://orcid.org/content/register-client-application-sandbox). Use https://api.sandbox.orcid.org as `site URL`
|
50
50
|
|
51
51
|
OmniAuth takes care of the OAuth external-authentication handshake or "dance". All that the gem does is grab the identifier and tokens at the end of the dance and stick it into the OmniAuth hash which is subsequently accessible to your app via `request.env['omniauth.auth']` (see [AuthHashSchema](https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema)). The hash looks something like this:
|
52
52
|
|
@@ -163,14 +163,14 @@ use OmniAuth::Builder do
|
|
163
163
|
scope: '/orcid-profile/read-limited'
|
164
164
|
},
|
165
165
|
client_options: {
|
166
|
-
site: ENV['
|
166
|
+
site: ENV['API_ORCID_URL'],
|
167
167
|
authorize_url: "#{ENV['ORCID_URL']}/oauth/authorize",
|
168
|
-
token_url: "#{ENV['
|
168
|
+
token_url: "#{ENV['API_ORCID_URL']}/oauth/token",
|
169
169
|
}
|
170
170
|
end
|
171
171
|
|
172
172
|
```
|
173
|
-
Where `ENV['ORCID_CLIENT_ID']` and `ENV['ORCID_CLIENT_SECRET']` are provided by ORCID when registering the application, and `ENV['
|
173
|
+
Where `ENV['ORCID_CLIENT_ID']` and `ENV['ORCID_CLIENT_SECRET']` are provided by ORCID when registering the application, and `ENV['API_ORCID_URL']` depends on the API you are using (see above).
|
174
174
|
|
175
175
|
|
176
176
|
## More information
|
@@ -6,33 +6,33 @@ module OmniAuth
|
|
6
6
|
module Strategies
|
7
7
|
class ORCID < OmniAuth::Strategies::OAuth2
|
8
8
|
|
9
|
-
|
9
|
+
option :name, "orcid"
|
10
10
|
|
11
11
|
option :client_options, {
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:scope => '/authenticate',
|
16
|
-
:response_type => 'code',
|
17
|
-
:mode => :header
|
12
|
+
site: 'https://pub.orcid.org',
|
13
|
+
authorize_url: 'https://orcid.org/oauth/authorize',
|
14
|
+
scope: '/authenticate'
|
18
15
|
}
|
19
16
|
|
20
|
-
|
21
|
-
|
17
|
+
def request_phase
|
18
|
+
options[:show_login] ||= "false"
|
19
|
+
super
|
20
|
+
end
|
21
|
+
|
22
|
+
uid { raw_info["orcid"] }
|
22
23
|
|
23
24
|
info do
|
24
|
-
{ name:
|
25
|
-
email: access_token.params["email"] }
|
25
|
+
{ name: raw_info["name"] }
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
extra do
|
29
|
+
{
|
30
|
+
'raw_info' => raw_info
|
31
|
+
}
|
32
|
+
end
|
30
33
|
|
31
|
-
|
32
|
-
|
33
|
-
%w[scope].each { |v| params[v.to_sym] = request.params[v] if request.params[v] }
|
34
|
-
params[:scope] ||= DEFAULT_SCOPE # ensure that we're always request *some* default scope
|
35
|
-
end
|
34
|
+
def raw_info
|
35
|
+
@raw_info ||= access_token.params
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
data/omniauth-orcid.gemspec
CHANGED
@@ -5,20 +5,20 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.authors = ["Gudmundur A. Thorisson", "Martin Fenner"]
|
6
6
|
s.email = ["gthorisson@gmail.com", "martin.fenner@datacite.org"]
|
7
7
|
s.name = "omniauth-orcid"
|
8
|
-
s.homepage =
|
9
|
-
s.summary =
|
8
|
+
s.homepage = "https://github.com/datacite/omniauth-orcid"
|
9
|
+
s.summary = "ORCID OAuth 2.0 Strategy for OmniAuth 1.0"
|
10
10
|
s.date = Date.today
|
11
|
-
s.description =
|
12
|
-
s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE.txt", "*.md", "Rakefile", "Gemfile", "demo.rb", "omniauth-orcid.gemspec"]
|
11
|
+
s.description = "Enables third-party client apps to connect to the ORCID API and access/update protected profile data"
|
13
12
|
s.require_paths = ["lib"]
|
14
13
|
s.version = OmniAuth::Orcid::VERSION
|
15
14
|
s.extra_rdoc_files = ["README.md"]
|
16
15
|
s.license = 'MIT'
|
17
16
|
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.require_paths = ["lib"]
|
18
20
|
|
19
21
|
# Declary dependencies here, rather than in the Gemfile
|
20
|
-
s.add_dependency 'omniauth', '~> 1.0'
|
21
22
|
s.add_dependency 'omniauth-oauth2', '~> 1.1'
|
22
|
-
|
23
|
+
s.add_development_dependency 'bundler', '~> 1.0'
|
23
24
|
end
|
24
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-orcid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gudmundur A. Thorisson
|
@@ -9,38 +9,38 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name: omniauth
|
15
|
+
name: omniauth-oauth2
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '1.
|
20
|
+
version: '1.1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '1.
|
27
|
+
version: '1.1'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1.
|
35
|
-
type: :
|
34
|
+
version: '1.0'
|
35
|
+
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1.
|
42
|
-
description:
|
43
|
-
protected profile data
|
41
|
+
version: '1.0'
|
42
|
+
description: Enables third-party client apps to connect to the ORCID API and access/update
|
43
|
+
protected profile data
|
44
44
|
email:
|
45
45
|
- gthorisson@gmail.com
|
46
46
|
- martin.fenner@datacite.org
|
@@ -49,6 +49,7 @@ extensions: []
|
|
49
49
|
extra_rdoc_files:
|
50
50
|
- README.md
|
51
51
|
files:
|
52
|
+
- ".gitignore"
|
52
53
|
- CHANGELOG.md
|
53
54
|
- Gemfile
|
54
55
|
- LICENSE.txt
|
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
81
|
version: '0'
|
81
82
|
requirements: []
|
82
83
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.4.5
|
84
|
+
rubygems_version: 2.4.5.1
|
84
85
|
signing_key:
|
85
86
|
specification_version: 4
|
86
87
|
summary: ORCID OAuth 2.0 Strategy for OmniAuth 1.0
|