omniauth-raven 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/omniauth/raven/version.rb +1 -1
- data/lib/omniauth/strategies/raven.rb +23 -1
- metadata +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'omniauth
|
1
|
+
require 'omniauth'
|
2
2
|
require 'cgi'
|
3
3
|
|
4
4
|
module OmniAuth
|
@@ -53,6 +53,28 @@ module OmniAuth
|
|
53
53
|
|
54
54
|
return redirect auth_url
|
55
55
|
end
|
56
|
+
|
57
|
+
def callback_phase
|
58
|
+
|
59
|
+
return fail!(:invalid_response) if request.params['WLS-Response'] == ""
|
60
|
+
|
61
|
+
wls_response = request.params['WLS-Response'].to_s
|
62
|
+
ver, status, msg, issue, id, url, principal, auth, sso, life, params, kid, sig = wls_response.split('!')
|
63
|
+
|
64
|
+
return fail!(:invalid_credentials) if status != "200"
|
65
|
+
|
66
|
+
@name = principal
|
67
|
+
@email = principal+"@cam.ac.uk"
|
68
|
+
|
69
|
+
super
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
uid { @email }
|
74
|
+
info {
|
75
|
+
options[:fields][:name] = @name
|
76
|
+
options[:fields][:email] = @email
|
77
|
+
}
|
56
78
|
end
|
57
79
|
end
|
58
80
|
end
|