omniauth-campus 0.2.0 → 0.2.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a3dc9cc4d549e8900c5630a91715580d7a4e963
|
|
4
|
+
data.tar.gz: a172090acfc9fcdc494a04e2d4b07b972cc3ef9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0fd69cf8113164e14f8d0a061f93a3e48f6f54515553b20e9f3c573734a2204dd23f6dd7f3f8bc1e42c7e45cd36a238efb3f27fc906bd78698a59f01fde32a2
|
|
7
|
+
data.tar.gz: 9d281bd205969fcc733f0cac9dd311574959baf6414626fad47d655e091c35ce138fa1acf0a2bc74ea286a8de0df8a6b6df47ca8ba16457f512fbcb3657151e8
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
require '
|
|
2
|
-
require '
|
|
1
|
+
require 'oauth2'
|
|
2
|
+
#require 'oauth'
|
|
3
|
+
#require 'omniauth'
|
|
3
4
|
require 'multi_json'
|
|
5
|
+
require 'uri'
|
|
4
6
|
|
|
5
7
|
#require 'rack/utils'
|
|
6
8
|
|
|
@@ -16,15 +18,28 @@ module OmniAuth
|
|
|
16
18
|
option :consumer_secret, nil
|
|
17
19
|
|
|
18
20
|
option :client_options, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
#:site => 'http://community3dev.devcloud.acquia-sites.com/api',
|
|
22
|
+
#:token_url => "/oauth/request_token",
|
|
23
|
+
#:access_url => "/oauth/request_access",
|
|
24
|
+
#:authorize_path => "/oauth/authorize"
|
|
23
25
|
|
|
26
|
+
:site => "www.vistacampus.org/",
|
|
27
|
+
:token_url => '/oauth/access_token',
|
|
28
|
+
:ssl => {:version => "SSLv3"}
|
|
24
29
|
}
|
|
25
30
|
option :fields, [:name, :email]
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
option :access_token_options, {
|
|
33
|
+
:header_format => 'OAuth %s',
|
|
34
|
+
:param_name => 'access_token'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
attr_accessor :access_token
|
|
38
|
+
|
|
39
|
+
def client
|
|
40
|
+
::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(options.client_options))
|
|
41
|
+
end
|
|
42
|
+
|
|
28
43
|
|
|
29
44
|
#site: 'http://community3dev.devcloud.acquia-sites.com/api'
|
|
30
45
|
|
|
@@ -37,19 +52,17 @@ module OmniAuth
|
|
|
37
52
|
#
|
|
38
53
|
#
|
|
39
54
|
|
|
40
|
-
#def request_phase
|
|
41
|
-
# form = OmniAuth::Form.new(:title => options.title, :url => callback_path)
|
|
42
|
-
# options.fields.each do |field|
|
|
43
|
-
# form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s
|
|
44
|
-
# end
|
|
45
|
-
# form.button "Sign In"
|
|
46
|
-
# form.to_response
|
|
47
|
-
#end
|
|
48
55
|
def request_phase
|
|
49
|
-
|
|
56
|
+
form = OmniAuth::Form.new(:title => options.title, :url => callback_path)
|
|
57
|
+
options.fields.each do |field|
|
|
58
|
+
form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s
|
|
59
|
+
end
|
|
60
|
+
form.button "Sign In"
|
|
61
|
+
form.to_response
|
|
50
62
|
end
|
|
51
63
|
|
|
52
|
-
|
|
64
|
+
|
|
65
|
+
uid {raw_info['uid']}
|
|
53
66
|
|
|
54
67
|
info do {
|
|
55
68
|
name: raw_info['name'],
|
|
@@ -62,7 +75,7 @@ module OmniAuth
|
|
|
62
75
|
end
|
|
63
76
|
|
|
64
77
|
def raw_info
|
|
65
|
-
@raw_info ||= MultiJson.decode(access_token.get('/
|
|
78
|
+
@raw_info ||= MultiJson.decode(access_token.get('/me')).body
|
|
66
79
|
end
|
|
67
80
|
|
|
68
81
|
end
|
data/omniauth-campus.gemspec
CHANGED
|
@@ -21,7 +21,8 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
|
22
22
|
spec.add_development_dependency "rake"
|
|
23
23
|
spec.add_runtime_dependency 'omniauth', '~> 1.0'
|
|
24
|
-
spec.add_runtime_dependency 'oauth'
|
|
24
|
+
#spec.add_runtime_dependency 'oauth'
|
|
25
|
+
spec.add_dependency 'oauth2', '~> 0.8.0'
|
|
25
26
|
spec.add_dependency 'faraday', ['>= 0.8', '<0.10']
|
|
26
27
|
spec.add_dependency 'multi_json', '~> 1.3'
|
|
27
28
|
end
|
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.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- johnvehr
|
|
@@ -53,19 +53,19 @@ dependencies:
|
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '1.0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: oauth2
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ~>
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: 0.8.0
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ~>
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version:
|
|
68
|
+
version: 0.8.0
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: faraday
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|