omniauth-windowslive 0.0.9 → 0.0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/README.md +4 -2
- data/lib/omniauth/strategies/windowslive.rb +33 -2
- data/lib/omniauth/windowslive/version.rb +1 -1
- data/spec/omniauth/strategies/windowslive_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -2
- data/spec/support/shared_examples.rb +8 -0
- metadata +5 -4
- data/.rvmrc +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 198b45114390a53510bbf1195ff710a4bc4820a5
|
4
|
+
data.tar.gz: 6f6614fb6712f729ff04d96cee51f3feecf33064
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aef90c012dd0a03e7cb914dd85d2f65d807447119dc9ab4d014f3725e6a63647e725bd05b0b58c508b4ac653d84727fcc126bed7dc8b12609f408e0c3068d21
|
7
|
+
data.tar.gz: 05d53443ba12da8dc89d4ae2e4ca5703971e0b64474451150a707a43a2857aa67ed797f44ae3e6b4ac321e15033b8e70ff381561049fb69ed444f1fad128f2bd
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
@omniauth-windowslive
|
data/.ruby-version
ADDED
@@ -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
|
-
|
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
|
-
'
|
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
|
-
|
86
|
+
|
87
|
+
OmniAuth.config.add_camelization 'windowslive', 'Windowslive'
|
@@ -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://
|
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("/
|
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('/
|
21
|
+
subject.client.options[:token_url].should eq('/oauth20_token.srf')
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
data/spec/spec_helper.rb
CHANGED
@@ -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:
|
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
|
-
- ".
|
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.
|
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
|