omniauth-campus 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f3ae5fa450c29c29caa0b7d18551d3e56688e85
4
- data.tar.gz: e0f42cb38d17492727b96d1f8a3ad813035cfc67
3
+ metadata.gz: 7fa43a2b642fe404b6c9d7788ea4ef9bfd65b163
4
+ data.tar.gz: 633f56acd36224b8e2bb88e61ca41ab157e484fd
5
5
  SHA512:
6
- metadata.gz: ad73ba64192edc3f907ae1a10cc5c32c619c91a08c6404a132898a1d01807ca5179ecb1f3b739f9b6ac670af0f4769a3ac8526110ebc7cfe8d67fd64c39262c3
7
- data.tar.gz: 61dfed49bfdfe5d9923bced0ab9eae98c497f1e8111b6be3a99d680466191165a9ffadcccd5587cf472fc3cd03d642f1751e908c992bd09638fb5d0c7f218375
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 :fields, [:name, :email]
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
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "0.6.5"
3
+ VERSION = "0.6.6"
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-campus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr