omniauth-td 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -24,8 +24,9 @@ The following information is provided back to you for this provider:
24
24
 
25
25
  ```ruby
26
26
  {
27
- uid: 'kazuki.ohta@gmail.com',
27
+ uid: 12345,
28
28
  info: {
29
+ account_id: 12345,
29
30
  email: 'kazuki.ohta@gmail.com'
30
31
  },
31
32
  credentials: {
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Td
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -23,17 +23,25 @@ module OmniAuth
23
23
  mail = request['email']
24
24
  pass = request['password']
25
25
  begin
26
+ api = TreasureData::Client.authenticate(mail, pass)
27
+ cln = TreasureData::Client.initialize(api.apikey)
26
28
  @identity ||= {
27
- :email => request['email'],
28
- :apikey => TreasureData::Client.authenticate(mail, pass).apikey
29
+ :account_id => cln.account.account_id,
30
+ :apikey => api.apikey,
31
+ :email => request['email']
29
32
  }
30
33
  rescue => e
31
34
  return fail!(:invalid_credentials)
32
35
  end
33
36
  super
34
37
  end
35
- uid { @identity[:email] }
36
- info { { :email => @identity[:email] } }
38
+ uid { @identity[:account_id] }
39
+ info {
40
+ {
41
+ :account_id => @identity[:account_id],
42
+ :email => @identity[:email]
43
+ }
44
+ }
37
45
  credentials { {:apikey => @identity[:apikey]} }
38
46
  end
39
47
  end
data/omniauth-td.gemspec CHANGED
@@ -16,5 +16,5 @@ Gem::Specification.new do |gem|
16
16
  gem.version = OmniAuth::Td::VERSION
17
17
 
18
18
  gem.add_dependency 'omniauth', '~> 1.0'
19
- gem.add_dependency 'td-client', '~> 0.8.21'
19
+ gem.add_dependency 'td-client', '~> 0.8.35'
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-19 00:00:00.000000000 Z
12
+ date: 2012-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 0.8.21
37
+ version: 0.8.35
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 0.8.21
45
+ version: 0.8.35
46
46
  description: OmniAuth strategy for Treasure Data
47
47
  email:
48
48
  - kazuki.ohta@gmail.com
@@ -80,9 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 1.8.21
83
+ rubygems_version: 1.8.24
84
84
  signing_key:
85
85
  specification_version: 3
86
86
  summary: OmniAuth strategy for Treasure Data
87
87
  test_files: []
88
- has_rdoc: