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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f04711606c8a7ae377a9b50a255dca491836c2e2
4
- data.tar.gz: 13bdb98924be6f31ed4db6918cb353764c643a14
3
+ metadata.gz: fce04069451ba0ca5b5d3495c633fae7e9c02b92
4
+ data.tar.gz: 4649198422eef2a44da36759f6d9e9f72c9a69dd
5
5
  SHA512:
6
- metadata.gz: 281df4a6d0033fefe24a1053959e61de2f718437cb59a9affe04d8605c66c5d515cb98da81886536af81bb09e5fc7bd94a90c52808c686bf0755a3ccbd2f4b51
7
- data.tar.gz: 7811ea15d2f35743ce1613ec1c8dd33b54e71c7d0743c53614760f61a2b5b8a1967d0f2f00033492e0dcafef30b4521f91fd5099535ddaeac42fea8390e0d263
6
+ metadata.gz: b2eac88abd71398b2538ae630cd7412e75df34ba9547d07e96287ad79e7e40c977204ab477d267f4c4bc43d07766ad39c48f75d26a6ba59704f7065ee6a2581b
7
+ data.tar.gz: 3ee719617cc7f174f14f10799e31402e1122cfd78873197483fbe22308da283f12ebc37551e9ac51b22105c99db529854b84b15b041b18b5cbcc1d10e949092d
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Orcid
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
@@ -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
- state: request.params["state"])
24
+ lang: request.params["lang"])
23
25
  end
24
26
 
25
- uid { raw_info["orcid"] }
27
+ uid { access_token.params["orcid"] }
26
28
 
27
29
  info do
28
- { name: raw_info["name"] }
30
+ { name: access_token.params["name"] }
29
31
  end
30
32
 
31
33
  extra do
32
- {
33
- 'raw_info' => raw_info
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.params
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
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
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gudmundur A. Thorisson