exvo-auth 0.1.2 → 0.1.3
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.
- data/README +48 -1
- data/VERSION +1 -1
- data/exvo-auth.gemspec +1 -1
- metadata +2 -2
data/README
CHANGED
@@ -1 +1,48 @@
|
|
1
|
-
|
1
|
+
-1. Read about OmniAuth by Intridea: http://github.com/intridea/omniauth.
|
2
|
+
|
3
|
+
|
4
|
+
0. Obtain client_id and client_secret from Exvo.
|
5
|
+
|
6
|
+
|
7
|
+
1. Install exvo-auth gem or add it to your Gemfile.
|
8
|
+
|
9
|
+
|
10
|
+
2. Configure middleware(s).
|
11
|
+
|
12
|
+
There are two middlewares. Usually you will need the "Interactive" one:
|
13
|
+
|
14
|
+
ExvoAuth::Strategies::Interactive
|
15
|
+
ExvoAuth::Strategies::NonInteractive
|
16
|
+
|
17
|
+
Both middlewares need client_id and client_secret arguments.
|
18
|
+
In Rails, the relevant line could look like this:
|
19
|
+
|
20
|
+
config.middleware.use ExvoAuth::Strategies::Interactive, "client_id", "client_secret"
|
21
|
+
|
22
|
+
|
23
|
+
3. Add routes.
|
24
|
+
|
25
|
+
The following comes from Rails config/routes.rb file:
|
26
|
+
|
27
|
+
match "/auth/failure" => "sessions#failure"
|
28
|
+
match "/auth/interactive/callback" => "sessions#create"
|
29
|
+
match "/auth/non_interactive/callback" => "sessions#create"
|
30
|
+
|
31
|
+
Failure url is called whenever there's a failure (d'oh).
|
32
|
+
You can have separate callbacks for interactive and non-interactive
|
33
|
+
callback routes but you can also route both callbacks to the same controller method
|
34
|
+
like shown above.
|
35
|
+
|
36
|
+
|
37
|
+
4. Implement callback(s).
|
38
|
+
|
39
|
+
Sample implementation:
|
40
|
+
|
41
|
+
def create
|
42
|
+
render :text => params[:auth].inspect
|
43
|
+
end
|
44
|
+
|
45
|
+
In short: you get params[:auth]. Do what you want to do with it: store the data, create session, etc.
|
46
|
+
|
47
|
+
|
48
|
+
5. Read the source, there are few features not mentioned in this README.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/exvo-auth.gemspec
CHANGED