omniauth-campus 0.6.5 → 0.6.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fa43a2b642fe404b6c9d7788ea4ef9bfd65b163
|
4
|
+
data.tar.gz: 633f56acd36224b8e2bb88e61ca41ab157e484fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7062bea9c24631029c407612089236e7753e64cbb31d65290b1e60f545881d6e6e93e94761aae20107b442d486d8b055517963e8d633e5f2a5a0882d09a4734
|
7
|
+
data.tar.gz: 51c7490569abd853c6b96bca748825f2d8401b5cdb37d4fc9b6b97f32a9951504c4a4b935578f367566b54382111a0fc0bf2bd5943b5d7f082691b79d8d8c4cd
|
Binary file
|
Binary file
|
@@ -3,6 +3,8 @@ require 'multi_json'
|
|
3
3
|
require 'faraday'
|
4
4
|
require 'net/http'
|
5
5
|
require 'open-uri'
|
6
|
+
require 'openssl'
|
7
|
+
require 'rack/utils'
|
6
8
|
|
7
9
|
|
8
10
|
require 'uri'
|
@@ -26,7 +28,37 @@ module OmniAuth
|
|
26
28
|
site: 'http://dev-oauth-test.gotpantheon.com/myawesomejson'
|
27
29
|
}
|
28
30
|
|
29
|
-
option :
|
31
|
+
option :token_params, {
|
32
|
+
:parse => :query
|
33
|
+
}
|
34
|
+
|
35
|
+
option :access_token_options, {
|
36
|
+
:header_format => 'Oauth %s',
|
37
|
+
:param_name => 'access_token'
|
38
|
+
}
|
39
|
+
|
40
|
+
option :authorize_options, [:scope, :display, :auth_type]
|
41
|
+
|
42
|
+
def request_phase
|
43
|
+
if signed_request_contains_access_token?
|
44
|
+
# If we already have an access token, we can just hit the callback URL directly and pass the signed request.
|
45
|
+
params = { :signed_request => raw_signed_request }
|
46
|
+
query = Rack::Utils.build_query(params)
|
47
|
+
|
48
|
+
url = callback_url
|
49
|
+
url << "?" unless url.match(/\?/)
|
50
|
+
url << "&" unless url.match(/[\&\?]$/)
|
51
|
+
url << query
|
52
|
+
|
53
|
+
redirect url
|
54
|
+
else
|
55
|
+
super
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def access_token_options
|
60
|
+
options.access_token_options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }
|
61
|
+
end
|
30
62
|
|
31
63
|
attr_accessor :access_token
|
32
64
|
|
Binary file
|