omniauth-orcid 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/orcid/version.rb +1 -1
- data/lib/omniauth/strategies/orcid.rb +10 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fce04069451ba0ca5b5d3495c633fae7e9c02b92
|
4
|
+
data.tar.gz: 4649198422eef2a44da36759f6d9e9f72c9a69dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2eac88abd71398b2538ae630cd7412e75df34ba9547d07e96287ad79e7e40c977204ab477d267f4c4bc43d07766ad39c48f75d26a6ba59704f7065ee6a2581b
|
7
|
+
data.tar.gz: 3ee719617cc7f174f14f10799e31402e1122cfd78873197483fbe22308da283f12ebc37551e9ac51b22105c99db529854b84b15b041b18b5cbcc1d10e949092d
|
@@ -7,35 +7,37 @@ module OmniAuth
|
|
7
7
|
class ORCID < OmniAuth::Strategies::OAuth2
|
8
8
|
|
9
9
|
DEFAULT_SCOPE = '/authenticate'
|
10
|
+
API_VERSION = '1.2'
|
10
11
|
|
11
12
|
option :name, "orcid"
|
12
13
|
|
13
14
|
option :client_options, {
|
14
15
|
site: 'https://pub.orcid.org',
|
15
16
|
authorize_url: 'https://orcid.org/oauth/authorize',
|
16
|
-
scope: '/authenticate'
|
17
|
+
scope: '/authenticate',
|
18
|
+
request_uri: options[:request_uri]
|
17
19
|
}
|
18
20
|
|
19
21
|
def authorize_params
|
20
22
|
super.merge(scope: request.params["scope"] || DEFAULT_SCOPE,
|
21
23
|
show_login: request.params["show_login"] || 'true',
|
22
|
-
|
24
|
+
lang: request.params["lang"])
|
23
25
|
end
|
24
26
|
|
25
|
-
uid {
|
27
|
+
uid { access_token.params["orcid"] }
|
26
28
|
|
27
29
|
info do
|
28
|
-
{ name:
|
30
|
+
{ name: access_token.params["name"] }
|
29
31
|
end
|
30
32
|
|
31
33
|
extra do
|
32
|
-
{
|
33
|
-
|
34
|
-
|
34
|
+
hsh = {}
|
35
|
+
hsh[:raw_info] = raw_info unless skip_info?
|
36
|
+
prune! hash
|
35
37
|
end
|
36
38
|
|
37
39
|
def raw_info
|
38
|
-
@raw_info ||= access_token.
|
40
|
+
@raw_info ||= access_token.get("https://pub.orcid.org//v#{API_VERSION}/#{uid}/orcid-bio").parsed
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|