omniauth-campus 0.4.2 → 0.4.3
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: b1726e6b57bfb76dc3b9894c66ff8451a264f2f0
|
4
|
+
data.tar.gz: 52b601ba06cce54555128ae20d3391b75a049675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50a180b57aa1e1210f505b1289c039b43025d229a604a46aca61543f60981e91f54ddedecfb7e535bf9f573d7abbc21c400aabe045328654a21ae1aa2ecc1037
|
7
|
+
data.tar.gz: dcd3ae45d47fcefcb68fc76fa1901022ae366a1fd9065d628be707dbe646b0e5ce872a7217d068cd05c145ffff8db2f62467c4ddfd46a58136513dc3edac2b67
|
Binary file
|
@@ -30,6 +30,12 @@ module OmniAuth
|
|
30
30
|
|
31
31
|
attr_accessor :access_token
|
32
32
|
|
33
|
+
def request_phase
|
34
|
+
response = Rack::Response.new
|
35
|
+
response.redirect(options.endpoint)
|
36
|
+
response.finish
|
37
|
+
end
|
38
|
+
|
33
39
|
|
34
40
|
|
35
41
|
#site' 'http://community3dev.devcloud.acquia-sites.com/api'
|
@@ -43,20 +49,7 @@ module OmniAuth
|
|
43
49
|
#
|
44
50
|
#
|
45
51
|
|
46
|
-
def request_phase
|
47
|
-
form = OmniAuth::Form.new(:title => options.title, :url => callback_path)
|
48
|
-
options.fields.each do |field|
|
49
|
-
form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s
|
50
|
-
end
|
51
|
-
form.button "Sign In"
|
52
|
-
form.to_response
|
53
|
-
end
|
54
52
|
|
55
|
-
def callback_phase
|
56
|
-
return fail!(:invalid_credentials) if !authentication_response
|
57
|
-
return fail!(:invalid_credentials) if authentication_response.code.to_i >= 400
|
58
|
-
super
|
59
|
-
end
|
60
53
|
|
61
54
|
|
62
55
|
uid {request['uid']}
|
@@ -68,27 +61,6 @@ module OmniAuth
|
|
68
61
|
end
|
69
62
|
|
70
63
|
|
71
|
-
def api_uri
|
72
|
-
options.endpoint
|
73
|
-
end
|
74
|
-
|
75
|
-
def authentication_response
|
76
|
-
unless @authentication_response
|
77
|
-
return unless request['name'] && request['email']
|
78
|
-
|
79
|
-
uri = URI(api_uri)
|
80
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
81
|
-
http.use_ssl = true
|
82
|
-
http.ssl_version = :SSLv3
|
83
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
84
|
-
|
85
|
-
req = Net::HTTP::Get.new(uri.request_uri)
|
86
|
-
req.basic_auth request['name'], request['email']
|
87
|
-
@authentication_response = http.request(req)
|
88
|
-
end
|
89
|
-
|
90
|
-
@authentication_response
|
91
|
-
end
|
92
64
|
|
93
65
|
end
|
94
66
|
end
|
Binary file
|