omniauth-windowslive 0.0.9 → 0.0.9.1

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: 06f6a92a6d87ba0e882782cc2ac5e86d22caee3d
4
- data.tar.gz: 045be44985d6e5769fe122dd9df9ee266b2c5368
3
+ metadata.gz: 198b45114390a53510bbf1195ff710a4bc4820a5
4
+ data.tar.gz: 6f6614fb6712f729ff04d96cee51f3feecf33064
5
5
  SHA512:
6
- metadata.gz: aa4e7de548b9830e2a0a073ed82cf7e06686d00aaae012854e603caf8cae386e20c297b5372426e424a5dba2b1f9253612fc38d6292e59b1694fb6d4a1bacd34
7
- data.tar.gz: c5e7042fe1e1f01ae884640bbad4cbf2758b72beba14a8a70df6a2d2bd3f4292194d7a7b7bc9b16745b4c0248c5b07f95b31c53b0965e9838ef5718d523a1579
6
+ metadata.gz: 4aef90c012dd0a03e7cb914dd85d2f65d807447119dc9ab4d014f3725e6a63647e725bd05b0b58c508b4ac653d84727fcc126bed7dc8b12609f408e0c3068d21
7
+ data.tar.gz: 05d53443ba12da8dc89d4ae2e4ca5703971e0b64474451150a707a43a2857aa67ed797f44ae3e6b4ac321e15033b8e70ff381561049fb69ed444f1fad128f2bd
@@ -0,0 +1 @@
1
+ @omniauth-windowslive
@@ -0,0 +1 @@
1
+ 2.2.2
data/README.md CHANGED
@@ -11,10 +11,12 @@ This gem contains the unofficial WindowsLive strategy for OmniAuth.
11
11
  ## Supported Flows
12
12
 
13
13
  for create app
14
- # https://manage.dev.live.com/Applications/Index?wa=wsignin1.0 OR https://manage.dev.live.com/AddApplication.aspx?tou=1
14
+ https://manage.dev.live.com/Applications/Index?wa=wsignin1.0
15
+ OR
16
+ https://manage.dev.live.com/AddApplication.aspx?tou=1
15
17
 
16
18
  ## Ruby
17
19
 
18
20
  Tested with the following Ruby versions:
19
21
 
20
- - RUBY 1.9.3-p0
22
+ - RUBY 1.9.3-p0
@@ -27,7 +27,7 @@ module OmniAuth
27
27
  info do
28
28
  {
29
29
  'id' => raw_info['id'],
30
- 'email' => raw_info['emails']['preferred'] || raw_info['emails']['account'],
30
+ 'emails' => emails_parser,
31
31
  'name' => raw_info['name'],
32
32
  'first_name' => raw_info['first_name'],
33
33
  'last_name' => raw_info['last_name'],
@@ -50,7 +50,38 @@ module OmniAuth
50
50
  @raw_info ||= MultiJson.decode(access_token.get(request).body)
51
51
  end
52
52
 
53
+ private
54
+
55
+ def emails_parser
56
+ emails = raw_info['emails']
57
+ emails_parsed = []
58
+
59
+ if emails
60
+ if emails['preferred']
61
+ emails_parsed << { 'value' => emails['preferred'], 'type' => 'preferred', 'primary' => true }
62
+ end
63
+
64
+ if emails['account']
65
+ emails_parsed << { 'value' => emails['account'], 'type' => 'account' }
66
+ end
67
+
68
+ if emails['personal']
69
+ emails_parsed << { 'value' => emails['personal'], 'type' => 'personal' }
70
+ end
71
+
72
+ if emails['business']
73
+ emails_parsed << { 'value' => emails['business'], 'type' => 'business' }
74
+ end
75
+
76
+ if emails['other']
77
+ emails_parsed << { 'value' => emails['other'], 'type' => 'other' }
78
+ end
79
+ end
80
+
81
+ emails_parsed
82
+ end
53
83
  end
54
84
  end
55
85
  end
56
- OmniAuth.config.add_camelization 'windowslive', 'Windowslive'
86
+
87
+ OmniAuth.config.add_camelization 'windowslive', 'Windowslive'
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Windowslive
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.9.1"
4
4
  end
5
5
  end
@@ -10,15 +10,15 @@ describe OmniAuth::Strategies::Windowslive do
10
10
 
11
11
  describe '#client' do
12
12
  it 'should have the correct Windowslive site' do
13
- subject.client.site.should eq("https://oauth.live.com")
13
+ subject.client.site.should eq("https://login.live.com")
14
14
  end
15
15
 
16
16
  it 'should have the correct authorization url' do
17
- subject.client.options[:authorize_url].should eq("/authorize")
17
+ subject.client.options[:authorize_url].should eq("/oauth20_authorize.srf")
18
18
  end
19
19
 
20
20
  it 'should have the correct token url' do
21
- subject.client.options[:token_url].should eq('/token')
21
+ subject.client.options[:token_url].should eq('/oauth20_token.srf')
22
22
  end
23
23
  end
24
24
 
@@ -11,5 +11,4 @@ Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
11
11
  RSpec.configure do |config|
12
12
  config.include Rack::Test::Methods
13
13
  config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
14
- end
15
-
14
+ end
@@ -1,6 +1,14 @@
1
1
  # NOTE it would be useful if this lived in omniauth-oauth2 eventually
2
2
 
3
3
  shared_examples 'an oauth2 strategy' do
4
+ before do
5
+ OmniAuth.config.test_mode = true
6
+ end
7
+
8
+ after do
9
+ OmniAuth.config.test_mode = false
10
+ end
11
+
4
12
  describe '#client' do
5
13
  it 'should be initialized with symbolized client_options' do
6
14
  @options = { :client_options => { 'authorize_url' => 'https://example.com' } }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-windowslive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel AZEMAR
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2015-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -88,7 +88,8 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
- - ".rvmrc"
91
+ - ".ruby-gemset"
92
+ - ".ruby-version"
92
93
  - Gemfile
93
94
  - LICENSE
94
95
  - README.md
@@ -120,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
121
  version: '0'
121
122
  requirements: []
122
123
  rubyforge_project: omniauth-windowslive
123
- rubygems_version: 2.2.2
124
+ rubygems_version: 2.4.6
124
125
  signing_key:
125
126
  specification_version: 4
126
127
  summary: Windows Live, Hotmail, SkyDrive, Windows Live Messenger, and other services...
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use ruby-1.9.3-p0@omniauth-windowslive --create