omniauth-orcid 1.0.2 → 1.0.3
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 +11 -3
- 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: 55c817897ccb1d8dcc81ae43fc827354a4c65051
|
4
|
+
data.tar.gz: 1040b4f7267fdb987c5ff526fdf9bb826bea6e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4f8e8096f92f0a003579a2aad107b1a4d56d4bdd54ecada707122b95cdb303ea984481efd0face12e3ec2de4590f270cc5729051fb79076950844f5268af058
|
7
|
+
data.tar.gz: 4cf6d8246b7f98897783e361a843a22eb203ff558a108d7ce2b416a6a67f7d336316606025c9c9c1fd391fba08e332b6f8fde8687f3862a419c69432e0e149e3
|
@@ -6,6 +6,9 @@ module OmniAuth
|
|
6
6
|
module Strategies
|
7
7
|
class ORCID < OmniAuth::Strategies::OAuth2
|
8
8
|
|
9
|
+
DEFAULT_SCOPE = '/authenticate'
|
10
|
+
DEFAULT_SHOW_LOGIN = 'true'
|
11
|
+
|
9
12
|
option :name, "orcid"
|
10
13
|
|
11
14
|
option :client_options, {
|
@@ -14,9 +17,14 @@ module OmniAuth
|
|
14
17
|
scope: '/authenticate'
|
15
18
|
}
|
16
19
|
|
17
|
-
def
|
18
|
-
|
19
|
-
|
20
|
+
def authorize_params
|
21
|
+
|
22
|
+
# Trick shamelessly borrowed from the omniauth-facebook gem!
|
23
|
+
super.tap do |params|
|
24
|
+
%w(scope show_login).each { |v| params[v.to_sym] = request.params[v] if request.params[v] }
|
25
|
+
params[:scope] ||= DEFAULT_SCOPE # ensure that we're always request *some* default scope
|
26
|
+
params[:show_login] ||= DEFAULT_SHOW_LOGIN # bypass registration screen
|
27
|
+
end
|
20
28
|
end
|
21
29
|
|
22
30
|
uid { raw_info["orcid"] }
|