omniauth-campus 0.2.9 → 0.3.0

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: 84d8b42e36087c256a8c423496008d1e4232d6c9
4
- data.tar.gz: bb5b6cb310dd1a8bc8146b595989d447cb1928fe
3
+ metadata.gz: 6f24efdde589ff6153290a35adf9c013b4d047d3
4
+ data.tar.gz: 010bfe57393a3b28788a031d0cc9f3eec515f079
5
5
  SHA512:
6
- metadata.gz: f08bb406e2a21ccaf8d68af4c3a37dc84b7e29a02c22c3bfcee5998a1942a5c6372d3ef158c1434a414d0d6e451902cec3d913a97ba6a57a41f9d349b06c406d
7
- data.tar.gz: 57e3221478813c102c404323a6e262a346f4874ce94d655d6117c47e6f17062afc26f002a314f5aae860a8b00ffc893d4c810a650dcc67cbabb5a99b93eb3dec
6
+ metadata.gz: fb96d8d7aaa6010a46514f0f6298634c13bfb09ed7465ec34161ceadcb50e6bd6ab5de179057cb4a8800909993a7183de33b43b0933160c10e555c59a4784ee5
7
+ data.tar.gz: 5ec16a997b1b6eeb75e3626d3629476b9881f5b169dc652a5cdd66f44db8b5e09dad3b0234b9cfb7e8c24fc0366d08ad1146c98969c3f29534b3dad7b98b8e48
Binary file
@@ -71,6 +71,27 @@ module OmniAuth
71
71
  @raw_info ||= MultiJson.decode(access_token.get('')).body
72
72
  end
73
73
 
74
+ def api_uri
75
+ options.endpoint
76
+ end
77
+
78
+ def authentication_response
79
+ unless @authentication_response
80
+ return unless raw_info['name'] && raw_info['email']
81
+
82
+ uri = URI(api_uri)
83
+ http = Net::HTTP.new(uri.host, uri.port)
84
+ http.use_ssl = true
85
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
86
+
87
+ req = Net::HTTP::Get.new(uri.request_uri)
88
+ req.basic_auth raw_info['name'], raw_info['email']
89
+ @authentication_response = http.request(req)
90
+ end
91
+
92
+ @authentication_response
93
+ end
94
+
74
95
  end
75
96
  end
76
97
  end
Binary file
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "0.2.9"
3
+ VERSION = "0.3.0"
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.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr