omniauth-campus 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b3624ed9f880116dc64155630ae4fc797ba426c
|
4
|
+
data.tar.gz: 762766d465585783b4e5148b3af69eab8316b1a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaea6b184428695052ec587b030f6cd94195a5be8f9ce997fce2c9e7a341455998d0e389675b59f0146047a934f078ebff7bed37931a0b7302050ea6cb064def
|
7
|
+
data.tar.gz: 7c0fd8883d467cd8d0ff984f591829fd57670b78cf00854fd469839b03474d1bad50b175a6c5242f7d003baa6968ce332e6a4719c68380950a718dfc31dc9914
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'oauth2'
|
2
2
|
#require 'oauth'
|
3
3
|
require 'omniauth'
|
4
4
|
require 'multi_json'
|
@@ -18,23 +18,25 @@ module OmniAuth
|
|
18
18
|
include OmniAuth::Strategy
|
19
19
|
|
20
20
|
option :name, 'campus'
|
21
|
-
args [:
|
22
|
-
option :
|
23
|
-
option :
|
24
|
-
option :
|
25
|
-
|
26
|
-
|
21
|
+
args [:client_id, :client_secret]
|
22
|
+
#option :consumer_key, "YzjVHuk8xoXCTcNwYg57yiCW5w59tucC"
|
23
|
+
#option :consumer_secret, "ZDrWuDsunNkRroU5psb6QyMmT86XkYST"
|
24
|
+
option :client_options, {
|
25
|
+
authorize_url: '/oauth/authorize',
|
26
|
+
token_url: '/oauth/token',
|
27
|
+
site: 'http://vistacampus.org'
|
28
|
+
}
|
27
29
|
|
28
30
|
option :fields, [:name, :email]
|
29
31
|
|
32
|
+
option :auth_token_params, {
|
33
|
+
param_name: 'access_token',
|
34
|
+
mode: :query
|
35
|
+
}
|
30
36
|
|
31
|
-
attr_accessor :access_token
|
32
37
|
|
33
|
-
|
34
|
-
|
35
|
-
response.redirect(options.endpoint)
|
36
|
-
response.finish
|
37
|
-
end
|
38
|
+
|
39
|
+
attr_accessor :access_token
|
38
40
|
|
39
41
|
|
40
42
|
|
@@ -52,14 +54,39 @@ module OmniAuth
|
|
52
54
|
|
53
55
|
|
54
56
|
|
55
|
-
uid {
|
57
|
+
uid {raw_info['uid']}
|
56
58
|
|
57
59
|
info do {
|
58
|
-
name:
|
59
|
-
email:
|
60
|
+
name: raw_info['name'],
|
61
|
+
email: raw_info['email']
|
60
62
|
}
|
61
63
|
end
|
62
64
|
|
65
|
+
def callback_url
|
66
|
+
options.authorize_params.callback_url or super
|
67
|
+
end
|
68
|
+
|
69
|
+
def request_phase
|
70
|
+
redirect client.auth_code.authorize_url({:redirect_uri => callback_url}.merge(options.authorize_params))
|
71
|
+
end
|
72
|
+
|
73
|
+
def raw_info
|
74
|
+
@raw_info ||= access_token.get('/api/v1/me.json').parsed
|
75
|
+
rescue ::Errno::ETIMEDOUT
|
76
|
+
raise ::Timeout::Error
|
77
|
+
end
|
78
|
+
|
79
|
+
def build_access_token
|
80
|
+
token_params = options.token_params.merge({
|
81
|
+
code: request.params['code'],
|
82
|
+
redirect_uri: callback_url,
|
83
|
+
client_id: client.id,
|
84
|
+
client_secret: client.secret
|
85
|
+
})
|
86
|
+
|
87
|
+
client.get_token(token_params, deep_symbolize(options.auth_token_params))
|
88
|
+
end
|
89
|
+
|
63
90
|
|
64
91
|
|
65
92
|
end
|
data/omniauth-campus.gemspec
CHANGED
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
-
spec.add_runtime_dependency 'omniauth', '~> 1.0'
|
23
|
+
#spec.add_runtime_dependency 'omniauth', '~> 1.0'
|
24
|
+
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.1.1'
|
24
25
|
spec.add_runtime_dependency 'oauth'
|
25
26
|
#spec.add_dependency 'oauth2', '~> 0.8.0'
|
26
27
|
spec.add_dependency 'faraday', ['>= 0.8', '<0.10']
|
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.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- johnvehr
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: omniauth
|
42
|
+
name: omniauth-oauth2
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.1.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.1.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: oauth
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|