omniauth-campus 0.0.10 → 0.1.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: 07307aa42fc4b79524cd5db1993e6447972ffbea
4
- data.tar.gz: 23d27caf8ef6098451d502e4e800819162c09150
3
+ metadata.gz: de319a8f2340e6e3097997c56a5b359199ccab24
4
+ data.tar.gz: d22a844895cf9b233504d7569fdca2d55c38f687
5
5
  SHA512:
6
- metadata.gz: a1b31304479c9a7502d9852bff38f4a6e097bee94473a1038a336ee1e311f3e318636a50fa34a179b0846ed685f03b5f3325f8606c9dd758e3485cbf524ea838
7
- data.tar.gz: 1c9c616afc306eb077665eec089f6ffa4aa56ce1b8cf0b1826656a1283f285d08629af30a8259896b42c2066f83486fafa3777972b2d95ca4a6cf677626a75ed
6
+ metadata.gz: 9acab6dffe9995ec7acbde7b13b82a7523dddad8d8b15d075a6bc9ba9a145a81af8ab05fc8fd92781861b57b69e526ffd33bd1f66bf1081e07c1abb165d81c8b
7
+ data.tar.gz: c3d430fc8fc8a0232cd2f795ceaf48324b520fe3cc0ac4dcc394e927bd34e9054b69cddcb59f79aa9802b1ca9ecbd69f5282b3e1846bb4c43084f77d407b5a92
Binary file
@@ -12,10 +12,13 @@ module OmniAuth
12
12
  class Campus
13
13
  include OmniAuth::Strategy
14
14
 
15
- args ['http://community3dev.devcloud.acquia-sites.com/api']
15
+ option :name, 'campus'
16
16
 
17
- option :title, "Http basic"
18
- option :headers, {}
17
+ args [:consumer_key, :consumer_secret]
18
+ option :consumer_key, nil
19
+ option :consumer_secret, nil
20
+ option :callback_url, nil
21
+ option :client_options, {}
19
22
 
20
23
  #site: 'http://community3dev.devcloud.acquia-sites.com/api'
21
24
 
@@ -26,6 +29,8 @@ module OmniAuth
26
29
  #
27
30
  # }
28
31
  #
32
+ #
33
+ uid {request.params['user_id']}
29
34
 
30
35
  def request_phase
31
36
  form = OmniAuth::Form.new(:title => options.title, :url => callback_path)
@@ -35,46 +40,8 @@ module OmniAuth
35
40
  form.to_response
36
41
  end
37
42
 
38
-
39
- def callback_phase
40
- return fail!(:invalid_credentials) if !authentication_response
41
- return fail!(:invalid_credentials) if authentication_response.code.to_i >= 400
42
- super
43
- end
44
-
45
- protected
46
-
47
- # by default we use static uri. If dynamic uri is required, override
48
- # this method.
49
- def api_uri
50
- 'http://community3dev.devcloud.acquia-sites.com/api'
51
- end
52
-
53
- def username
54
- request['username']
55
- end
56
-
57
- def password
58
- request['password']
59
- end
60
-
61
- def authentication_response
62
- unless @authentication_response
63
- return unless username && password
64
-
65
- uri = URI(api_uri)
66
- http = Net::HTTP.new(uri.host, uri.port)
67
- if uri.scheme == 'https'
68
- http.use_ssl = true
69
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
70
- end
71
-
72
- req = Net::HTTP::Get.new(uri.request_uri)
73
- req.basic_auth username, password
74
- @authentication_response = http.request(req)
75
- end
76
-
77
- @authentication_response
43
+ def raw_info
44
+ @raw_info ||= MultiJson.decode(access_token.get('http://community3dev.devcloud.acquia-sites.com/api')).body
78
45
  end
79
46
 
80
47
  end
Binary file
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "0.0.10"
3
+ VERSION = "0.1.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.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr