omniauth-windowslive 0.0.9.1 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/Gemfile +6 -0
- data/README.md +11 -1
- data/lib/omniauth/strategies/windowslive.rb +20 -13
- data/lib/omniauth/windowslive/version.rb +1 -1
- data/spec/omniauth/strategies/windowslive_spec.rb +0 -1
- data/spec/spec_helper.rb +12 -7
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d330f2110b7b5fecd90e55b5021a46ecf050cac
|
4
|
+
data.tar.gz: ee1daace6a355ca1d602c32eda87b93b4de4bcd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d467908cacdb035a405e69a7691b22068f68ea91f21f608597cf0e7108d53adca77d80b4cea8676c9b007c049767c3e4f3bcba53570cac65c614aaf83199a6b5
|
7
|
+
data.tar.gz: 667eb9911e64fe22fcceadcb2e004b2d4a289e05a1cfa3ff43a0dbd77689a5af1111300da4366068d72fd4dcb348cda0dcf6f665c5e565a095bcff72b78d983d
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# OmniAuth Windows Live
|
2
2
|
|
3
|
+
[![Code Climate](https://codeclimate.com/github/joel/omniauth-windowslive.png)](https://codeclimate.com/github/joel/omniauth-windowslive)
|
4
|
+
|
5
|
+
[![Dependency Status](https://gemnasium.com/joel/omniauth-windowslive.svg)](https://gemnasium.com/joel/omniauth-windowslive)
|
6
|
+
|
7
|
+
[![Build Status](https://travis-ci.org/joel/omniauth-windowslive.svg?branch=master)](https://travis-ci.org/joel/omniauth-windowslive) (Travis CI)
|
8
|
+
|
9
|
+
[![Coverage Status](https://coveralls.io/repos/joel/omniauth-windowslive/badge.svg?branch=master&service=github)](https://coveralls.io/github/joel/omniauth-windowslive?branch=master)
|
10
|
+
|
11
|
+
[![Gem Version](https://badge.fury.io/rb/omniauth-windowslive.svg)](http://badge.fury.io/rb/omniauth-windowslive)
|
12
|
+
|
3
13
|
This gem contains the unofficial WindowsLive strategy for OmniAuth.
|
4
14
|
|
5
15
|
## Basic Usage
|
@@ -19,4 +29,4 @@ https://manage.dev.live.com/AddApplication.aspx?tou=1
|
|
19
29
|
|
20
30
|
Tested with the following Ruby versions:
|
21
31
|
|
22
|
-
- RUBY
|
32
|
+
- RUBY 2.2.2
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'uri'
|
1
2
|
require 'omniauth/strategies/oauth2'
|
2
3
|
|
3
4
|
# http://msdn.microsoft.com/en-us/library/hh243647.aspx
|
@@ -10,13 +11,13 @@ module OmniAuth
|
|
10
11
|
DEFAULT_SCOPE = 'wl.basic,wl.emails,wl.photos'
|
11
12
|
|
12
13
|
option :client_options, {
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
14
|
+
site: 'https://login.live.com',
|
15
|
+
authorize_url: '/oauth20_authorize.srf',
|
16
|
+
token_url: '/oauth20_token.srf'
|
16
17
|
}
|
17
18
|
|
18
19
|
option :authorize_params, {
|
19
|
-
:
|
20
|
+
response_type: 'code'
|
20
21
|
}
|
21
22
|
|
22
23
|
option :name, 'windowslive'
|
@@ -26,14 +27,14 @@ module OmniAuth
|
|
26
27
|
# http://msdn.microsoft.com/en-us/library/hh243648.aspx
|
27
28
|
info do
|
28
29
|
{
|
29
|
-
'id'
|
30
|
-
'emails'
|
31
|
-
'name'
|
32
|
-
'first_name'
|
33
|
-
'last_name'
|
34
|
-
'gender'
|
35
|
-
'link'
|
36
|
-
'locale'
|
30
|
+
'id' => raw_info['id'],
|
31
|
+
'emails' => emails_parser,
|
32
|
+
'name' => raw_info['name'],
|
33
|
+
'first_name' => raw_info['first_name'],
|
34
|
+
'last_name' => raw_info['last_name'],
|
35
|
+
'gender' => raw_info['gender'],
|
36
|
+
'link' => raw_info['link'],
|
37
|
+
'locale' => raw_info['locale'],
|
37
38
|
'updated_time' => raw_info['updated_time']
|
38
39
|
}
|
39
40
|
end
|
@@ -51,6 +52,12 @@ module OmniAuth
|
|
51
52
|
end
|
52
53
|
|
53
54
|
private
|
55
|
+
|
56
|
+
def build_access_token
|
57
|
+
verifier = request.params["code"]
|
58
|
+
redirect_uri = URI.parse(callback_url).tap { |uri| uri.query = nil }.to_s
|
59
|
+
client.auth_code.get_token(verifier, {:redirect_uri => redirect_uri}.merge(token_params.to_hash(:symbolize_keys => true)), deep_symbolize(options.auth_token_params))
|
60
|
+
end
|
54
61
|
|
55
62
|
def emails_parser
|
56
63
|
emails = raw_info['emails']
|
@@ -84,4 +91,4 @@ module OmniAuth
|
|
84
91
|
end
|
85
92
|
end
|
86
93
|
|
87
|
-
OmniAuth.config.add_camelization 'windowslive', 'Windowslive'
|
94
|
+
OmniAuth.config.add_camelization 'windowslive', 'Windowslive'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,19 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'omniauth/windowslive'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'coveralls'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'pry'
|
7
|
+
rescue LoadError
|
8
|
+
end
|
3
9
|
|
4
|
-
require 'rspec'
|
5
10
|
require 'rack/test'
|
6
|
-
|
7
|
-
|
11
|
+
|
12
|
+
Coveralls.wear!
|
8
13
|
|
9
14
|
Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
|
10
15
|
|
11
16
|
RSpec.configure do |config|
|
12
17
|
config.include Rack::Test::Methods
|
13
|
-
config.extend OmniAuth::Test::StrategyMacros, :
|
14
|
-
end
|
18
|
+
config.extend OmniAuth::Test::StrategyMacros, type: :strategy
|
19
|
+
end
|
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.
|
4
|
+
version: 0.0.10
|
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: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- ".gitignore"
|
91
91
|
- ".ruby-gemset"
|
92
92
|
- ".ruby-version"
|
93
|
+
- ".travis.yml"
|
93
94
|
- Gemfile
|
94
95
|
- LICENSE
|
95
96
|
- README.md
|
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
122
|
version: '0'
|
122
123
|
requirements: []
|
123
124
|
rubyforge_project: omniauth-windowslive
|
124
|
-
rubygems_version: 2.4.
|
125
|
+
rubygems_version: 2.4.5
|
125
126
|
signing_key:
|
126
127
|
specification_version: 4
|
127
128
|
summary: Windows Live, Hotmail, SkyDrive, Windows Live Messenger, and other services...
|