exvo-auth 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -4
- data/VERSION +1 -1
- data/exvo-auth.gemspec +2 -2
- data/lib/exvo_auth/config.rb +15 -4
- data/lib/exvo_auth/oauth2.rb +1 -2
- data/lib/exvo_auth/path_helpers.rb +1 -1
- data/lib/exvo_auth/strategies/non_interactive.rb +2 -2
- metadata +3 -3
data/README
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
-1.
|
1
|
+
-1. Get familiar with OmniAuth by Intridea: http://github.com/intridea/omniauth. Read about OAuth2.
|
2
2
|
|
3
3
|
|
4
|
-
0. Obtain client_id and client_secret from Exvo.
|
4
|
+
0. Obtain client_id and client_secret for your app from Exvo.
|
5
5
|
|
6
6
|
|
7
7
|
1. Install exvo-auth gem or add it to your Gemfile.
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
2. Configure middleware(s).
|
11
11
|
|
12
|
-
There are two middlewares. Usually you will need the "
|
12
|
+
There are two middlewares. Usually you will need the "interactive" one:
|
13
13
|
|
14
14
|
ExvoAuth::Strategies::Interactive
|
15
15
|
ExvoAuth::Strategies::NonInteractive
|
@@ -36,7 +36,7 @@ like shown above.
|
|
36
36
|
|
37
37
|
4. Implement callback(s).
|
38
38
|
|
39
|
-
Sample implementation:
|
39
|
+
Sample implementation in SessionsController:
|
40
40
|
|
41
41
|
def create
|
42
42
|
render :text => params[:auth].inspect
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/exvo-auth.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{exvo-auth}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jacek Becela"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-25}
|
13
13
|
s.description = %q{Sign in with Exvo account}
|
14
14
|
s.email = %q{jacek.becela@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/exvo_auth/config.rb
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
module ExvoAuth::Config
|
2
|
-
def self.host
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
def self.host
|
3
|
+
@@host || 'https://auth.exvo.com'
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.host=(host)
|
7
|
+
@@host = host
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.callback_key
|
11
|
+
@@callback_key || '_callback'
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.callback_key=(callback_key)
|
15
|
+
@@callback_key = callback_key
|
16
|
+
end
|
6
17
|
end
|
data/lib/exvo_auth/oauth2.rb
CHANGED
@@ -9,10 +9,9 @@
|
|
9
9
|
# that doesn't match current authentication grant.
|
10
10
|
#
|
11
11
|
# This strategy is needed to sign users in during json/jsonp requests,
|
12
|
-
# which cannot result in any interactive flows.
|
12
|
+
# which cannot result in any interactive/navigational flows.
|
13
13
|
class ExvoAuth::OAuth2::Strategy::NonInteractive < ::OAuth2::Strategy::WebServer
|
14
14
|
def authorize_params(options = {})
|
15
15
|
super(options).merge('type' => 'non_interactive')
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ExvoAuth::PathHelpers
|
2
2
|
def self.included(base)
|
3
3
|
if base.respond_to?(:helper_method)
|
4
|
-
base.helper_method :interactive_sign_in_path, :non_interactive_sign_in_path, :
|
4
|
+
base.helper_method :interactive_sign_in_path, :non_interactive_sign_in_path, :auth_sign_out_url
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
@@ -4,7 +4,7 @@ class ExvoAuth::Strategies::NonInteractive < ExvoAuth::Strategies::Base
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def request_phase(options = {})
|
7
|
-
redirect @client.non_interactive.authorize_url(
|
7
|
+
redirect @client.non_interactive.authorize_url(:redirect_uri => callback_url, :scope => request["scope"])
|
8
8
|
end
|
9
9
|
|
10
10
|
def callback_url
|
@@ -19,6 +19,6 @@ class ExvoAuth::Strategies::NonInteractive < ExvoAuth::Strategies::Base
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def fail!(message_key)
|
22
|
-
[200, { "Content-Type" => "application/json" }, [MultiJson.encode(
|
22
|
+
[200, { "Content-Type" => "application/json" }, [MultiJson.encode(:message => "Not signed in!", :status => 401)]]
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jacek Becela
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-25 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|