omniauth-etrade 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-etrade/version.rb +1 -1
- data/lib/omniauth/strategies/etrade.rb +22 -1
- data/omniauth-etrade.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a13b4faadfddfa04581b5d94cff2aba966a3e86
|
4
|
+
data.tar.gz: 08add985bb607cf701b7c6321fe297512dc43b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761615071f5182cc940deffa694c033732884fcc6143fea7b59cac195b26903c707010c5ba28a1d8eabcbd3ee0c41996f4bf5926a3b02375f8b6fc4c2e44f0be
|
7
|
+
data.tar.gz: d30bbcb10c2defab5f110f9f611f9ca8d4c84f76a81905f2a7c441ac728b60b504c34089b8e0f414884ec87eb240a145315aaaaf8a0e39a59c65df60b278a27f
|
@@ -3,6 +3,7 @@ require 'omniauth-oauth'
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
5
|
class Etrade < OmniAuth::Strategies::OAuth
|
6
|
+
|
6
7
|
option :client_options, {
|
7
8
|
:site => 'https://etws.etrade.com',
|
8
9
|
:authorize_url => 'https://us.etrade.com/e/t/etws/authorize',
|
@@ -14,6 +15,25 @@ module OmniAuth
|
|
14
15
|
'oob'
|
15
16
|
end
|
16
17
|
|
18
|
+
def request_phase
|
19
|
+
request_token = consumer.get_request_token({:oauth_callback => callback_url}, options.request_params)
|
20
|
+
session['oauth'] ||= {}
|
21
|
+
session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
|
22
|
+
|
23
|
+
if request_token.callback_confirmed?
|
24
|
+
redirect request_token.authorize_url({key: options.consumer_key}.merge(options[:authorize_params])).sub! 'oauth_token', 'token'
|
25
|
+
else
|
26
|
+
redirect request_token.authorize_url(options[:authorize_params].merge(oauth_callback: callback_url, key: options.consumer_key)).sub! 'oauth_token', 'token'
|
27
|
+
end
|
28
|
+
|
29
|
+
rescue ::Timeout::Error => e
|
30
|
+
fail!(:timeout, e)
|
31
|
+
rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
|
32
|
+
fail!(:service_unavailable, e)
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
|
17
37
|
uid { raw_info['uid'] }
|
18
38
|
|
19
39
|
info do
|
@@ -29,7 +49,8 @@ module OmniAuth
|
|
29
49
|
end
|
30
50
|
|
31
51
|
def raw_info
|
32
|
-
|
52
|
+
Rails.logger.debug(access_token.to_yaml)
|
53
|
+
@raw_info ||= MultiJson.decode(access_token.get('/1/account/info').body)
|
33
54
|
end
|
34
55
|
|
35
56
|
end
|
data/omniauth-etrade.gemspec
CHANGED
@@ -8,10 +8,10 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = "omniauth-etrade"
|
9
9
|
spec.version = OmniAuth::Etrade::VERSION
|
10
10
|
spec.authors = ["Athens Holloway"]
|
11
|
-
spec.email = ["
|
11
|
+
spec.email = ["athens@uvest.co"]
|
12
12
|
spec.description = %q{OmniAuth strategy of E*TRADE}
|
13
13
|
spec.summary = %q{OmniAuth strategy of E*TRADE}
|
14
|
-
spec.homepage = "https://github.com/
|
14
|
+
spec.homepage = "https://github.com/uvest/omniauth-etrade"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-etrade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Athens Holloway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -124,7 +124,7 @@ dependencies:
|
|
124
124
|
version: '0'
|
125
125
|
description: OmniAuth strategy of E*TRADE
|
126
126
|
email:
|
127
|
-
-
|
127
|
+
- athens@uvest.co
|
128
128
|
executables: []
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
@@ -139,7 +139,7 @@ files:
|
|
139
139
|
- lib/omniauth-etrade/version.rb
|
140
140
|
- lib/omniauth/strategies/etrade.rb
|
141
141
|
- omniauth-etrade.gemspec
|
142
|
-
homepage: https://github.com/
|
142
|
+
homepage: https://github.com/uvest/omniauth-etrade
|
143
143
|
licenses:
|
144
144
|
- MIT
|
145
145
|
metadata: {}
|