omniauth-myvr 0.1.0 → 0.1.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/example/config.ru +3 -4
- data/lib/omniauth/strategies/myvr.rb +17 -17
- data/omniauth-myvr.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccb311710bd6541f08122b2ac39706a7d4f3ae9a
|
|
4
|
+
data.tar.gz: 8fe709f90a6de6f270d36b6780dc7a2f3935ca9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de48d998e2c892027530b4a6a18f0a310410bac3177bbff02530cf0b86c054d4685c83d7912c8b4f10f002a25a4148070636cd522857a7bfb6ecf78e0338724b
|
|
7
|
+
data.tar.gz: 4a221e3e5add9bf521fc73d4d035910a4454aaf133e2474d886bf1508cbf65f8c383f1d58cb5579d91eeb24f7b6ab46f94f7ed8299b804fe7dbd44570e6229c3
|
data/example/config.ru
CHANGED
|
@@ -8,8 +8,6 @@ require 'sinatra'
|
|
|
8
8
|
require 'omniauth'
|
|
9
9
|
require '../lib/omniauth_myvr'
|
|
10
10
|
|
|
11
|
-
ENV['BASE_SCOPE_URL'] = 'http://local.api.myvr.com:8000/auth/'
|
|
12
|
-
ENV['BASE_SITE'] = 'http://local.api.myvr.com:8000/'
|
|
13
11
|
ENV['MYVR_KEY'] = '811f088e585dd0e4beaba9e758059f02'
|
|
14
12
|
ENV['MYVR_SECRET'] = '6e33b7189bc37bdeb571f94c366b6ef5'
|
|
15
13
|
# Do not use for production code.
|
|
@@ -42,8 +40,9 @@ end
|
|
|
42
40
|
use Rack::Session::Cookie, :secret => ENV['RACK_COOKIE_SECRET']
|
|
43
41
|
|
|
44
42
|
use OmniAuth::Builder do
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
provider :myvr, ENV['MYVR_KEY'], ENV['MYVR_SECRET'], {
|
|
44
|
+
scope: 'rate_read'
|
|
45
|
+
}
|
|
47
46
|
end
|
|
48
47
|
|
|
49
48
|
run App.new
|
|
@@ -4,21 +4,31 @@ require 'omniauth/strategies/oauth2'
|
|
|
4
4
|
require 'uri'
|
|
5
5
|
require 'httplog'
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
module OmniAuth
|
|
8
9
|
module Strategies
|
|
9
10
|
class Myvr < OmniAuth::Strategies::OAuth2
|
|
10
|
-
|
|
11
|
+
if ENV['DEV']
|
|
12
|
+
BASE_SCOPE_URL = "http://local.api.myvr.com:8000/auth/"
|
|
13
|
+
option :client_options, {
|
|
14
|
+
:site => 'http://local.myvr.com:8000/',
|
|
15
|
+
:authorize_url => 'http://local.myvr.com:8000/connect/oauth/auth',
|
|
16
|
+
:token_url => 'http://api.local.myvr.com:8000/oauth/token/'
|
|
17
|
+
}
|
|
18
|
+
else
|
|
19
|
+
BASE_SCOPE_URL = "https://api.myvr.com/auth/"
|
|
20
|
+
option :client_options, {
|
|
21
|
+
:site => 'https://myvr.com/',
|
|
22
|
+
:authorize_url => 'https://myvr.com/connect/oauth/auth',
|
|
23
|
+
:token_url => 'https://api.myvr.com/oauth/token/'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
11
27
|
BASE_SCOPES = %w[property_read]
|
|
12
28
|
DEFAULT_SCOPE = 'property_read'
|
|
13
29
|
|
|
14
30
|
option :name, 'myvr'
|
|
15
31
|
option :authorize_params, {grant_type: 'authorization_code'}
|
|
16
|
-
option :client_options, {
|
|
17
|
-
:site => 'http://local.myvr.com:8000/',
|
|
18
|
-
:authorize_url => 'http://local.myvr.com:8000/connect/oauth/auth',
|
|
19
|
-
:token_url => 'http://api.local.myvr.com:8000/oauth/token/'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
32
|
# uid { raw_info['sub'] || verified_email }
|
|
23
33
|
#
|
|
24
34
|
# info do
|
|
@@ -80,16 +90,6 @@ module OmniAuth
|
|
|
80
90
|
verifier = request.params['code']
|
|
81
91
|
client.auth_code.get_token(verifier, token_params)
|
|
82
92
|
end
|
|
83
|
-
|
|
84
|
-
private
|
|
85
|
-
|
|
86
|
-
def callback_url
|
|
87
|
-
options[:redirect_uri] || (full_host + script_name + callback_path)
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def get_token_options(redirect_uri)
|
|
91
|
-
{ :redirect_uri => redirect_uri }.merge(token_params.to_hash(:symbolize_keys => true))
|
|
92
|
-
end
|
|
93
93
|
end
|
|
94
94
|
end
|
|
95
95
|
end
|
data/omniauth-myvr.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "omniauth-myvr"
|
|
6
|
-
s.version = "0.1.
|
|
6
|
+
s.version = "0.1.1"
|
|
7
7
|
s.authors = ["CJ Avilla"]
|
|
8
8
|
s.email = ["cjavilla@gmail.com"]
|
|
9
9
|
s.homepage = "https://github.com/w1zeman1p/omniauth-myvr"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-myvr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- CJ Avilla
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-06-
|
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: omniauth
|