omniauth-campus 0.5.6 → 0.5.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2cc15a78a6c8ca09ac2a893eea45a4375bb92b0
|
4
|
+
data.tar.gz: 2ce1bf50d0ef3793000765360b82abffaad7a06b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf79bd8131195df9faabd31df4e58c4e47734b07a3cb6f0e5db613f7635f0fee2c0a4d573cd2ef911113672ebc138d30b3f15281235e5607de1188458c6e696e
|
7
|
+
data.tar.gz: 7f1ccb86b364c9060ca77137b99f8147ae3a6a65fe5a3c848f1d4184bf208d49e077f645952e687474a80c610ca9c6f839389a50e688d2471b93ce4afd14843f
|
Binary file
|
@@ -14,6 +14,9 @@ module OmniAuth
|
|
14
14
|
# Your code goes here...
|
15
15
|
class Campus < OmniAuth::Strategies::OAuth2
|
16
16
|
|
17
|
+
DEFAULT_RESPONSE_TYPE = 'code'
|
18
|
+
DEFAULT_GRANT = 'authorization_code'
|
19
|
+
|
17
20
|
option :name, 'campus'
|
18
21
|
args [:client_id, :client_secret]
|
19
22
|
#option :consumer_key, "YzjVHuk8xoXCTcNwYg57yiCW5w59tucC"
|
@@ -38,6 +41,21 @@ module OmniAuth
|
|
38
41
|
# }
|
39
42
|
#
|
40
43
|
|
44
|
+
def authorize_params
|
45
|
+
super.tap do |params|
|
46
|
+
params[:response_type] ||= DEFAULT_RESPONSE_TYPE
|
47
|
+
params[:client_id] = client.id
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def token_params
|
52
|
+
super.tap do |params|
|
53
|
+
params[:grant_type] ||= DEFAULT_GRANT
|
54
|
+
params[:client_id] = client.id
|
55
|
+
params[:client_secret] = client.secret
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
41
59
|
def request_phase
|
42
60
|
redirect client.auth_code.authorize_url({:redirect_uri => callback_url}.merge(options.authorize_params))
|
43
61
|
end
|
Binary file
|