omniauth-campus 0.2.8 → 0.2.9

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: 9fef39e076b6c20d3bbdebe70e7613e0f94187d3
4
- data.tar.gz: 75ad73e23db32c536f8c7041627b0067bab97a2e
3
+ metadata.gz: 84d8b42e36087c256a8c423496008d1e4232d6c9
4
+ data.tar.gz: bb5b6cb310dd1a8bc8146b595989d447cb1928fe
5
5
  SHA512:
6
- metadata.gz: a5764a3a2a9e3199c094beb97cb483361f02125481315f07ddc25b4f36ae19944f85badf4278c1c6209adc050c3cea0cef712717f02c95252d7e5f658cddc58c
7
- data.tar.gz: 14ad0a5e5155a4317ff2c7ad864171c64c84c32b6f19c8efc23808665723705b5542f849cd6f636d00979e4cfa56a539d372be9a39b2f0ee7483c75d0c9423f8
6
+ metadata.gz: f08bb406e2a21ccaf8d68af4c3a37dc84b7e29a02c22c3bfcee5998a1942a5c6372d3ef158c1434a414d0d6e451902cec3d913a97ba6a57a41f9d349b06c406d
7
+ data.tar.gz: 57e3221478813c102c404323a6e262a346f4874ce94d655d6117c47e6f17062afc26f002a314f5aae860a8b00ffc893d4c810a650dcc67cbabb5a99b93eb3dec
Binary file
Binary file
@@ -2,7 +2,7 @@ require 'oauth'
2
2
  #require 'oauth'
3
3
  require 'omniauth'
4
4
  require 'multi_json'
5
- require 'omniauth-http-basic'
5
+ require 'net/http'
6
6
  require 'uri'
7
7
 
8
8
  #require 'rack/utils'
@@ -18,7 +18,8 @@ module OmniAuth
18
18
  option :endpoint, 'http://community3dev.devcloud.acquia-sites.com/api'
19
19
  option :consumer_key, "YzjVHuk8xoXCTcNwYg57yiCW5w59tucC"
20
20
  option :consumer_secret, "ZDrWuDsunNkRroU5psb6QyMmT86XkYST"
21
-
21
+ option :authorize_params, {}
22
+ option :request_params, {}
22
23
 
23
24
  option :fields, [:name, :email]
24
25
 
@@ -47,51 +48,29 @@ module OmniAuth
47
48
  form.to_response
48
49
  end
49
50
 
50
-
51
- def api_uri
52
- options.endpoint
51
+ def callback_phase
52
+ return fail!(:invalid_credentials) if !authentication_response
53
+ return fail!(:invalid_credentials) if authentication_response.code.to_i >= 400
54
+ super
53
55
  end
54
56
 
55
- def name
56
- request['name']
57
- end
58
57
 
59
- def email
60
- request['email']
61
- end
58
+ uid {raw_info['uid']}
62
59
 
60
+ info do {
61
+ name: raw_info['name'],
62
+ email: raw_info['email']
63
+ }
64
+ end
63
65
 
64
- #uid {raw_info['uid']}
65
-
66
- #info do {
67
- # name: raw_info['name'],
68
- # email: raw_info['email']
69
- #}
70
- #end
71
- #
72
- # extra do
73
- # raw_info
74
- # end
75
-
76
- # def raw_info
77
- # @raw_info ||= MultiJson.decode(access_token.get('/me')).body
78
- # end
79
-
80
- def authentication_response
81
- unless @authentication_response
82
- return unless name && email
83
-
84
- uri = URI(api_uri)
85
- http = Net::HTTP.new(uri.host, uri.port)
86
- http.use_ssl = OpenSSL::SSL::VERIFY_PEER
87
-
88
- req = Net::HTTP::Get.new(uri.request_uri)
89
- req.basic_auth name, email
90
- @authentication_response = http.request(req)
91
- end
66
+ extra do
67
+ raw_info
68
+ end
92
69
 
93
- @authentication_response
70
+ def raw_info
71
+ @raw_info ||= MultiJson.decode(access_token.get('')).body
94
72
  end
73
+
95
74
  end
96
75
  end
97
76
  end
Binary file
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "0.2.8"
3
+ VERSION = "0.2.9"
4
4
  end
5
5
  end
6
6
 
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_runtime_dependency 'omniauth', '~> 1.0'
24
24
  spec.add_runtime_dependency 'oauth'
25
- spec.add_dependency 'omniauth-http-basic', '~> 1.0'
26
25
  #spec.add_dependency 'oauth2', '~> 0.8.0'
27
26
  spec.add_dependency 'faraday', ['>= 0.8', '<0.10']
28
27
  spec.add_dependency 'multi_json', '~> 1.3'
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.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: omniauth-http-basic
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- version: '1.0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ~>
81
- - !ruby/object:Gem::Version
82
- version: '1.0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: faraday
85
71
  requirement: !ruby/object:Gem::Requirement