just_open_id 0.0.2 → 0.0.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/Gemfile.lock +1 -1
- data/README +25 -4
- data/config/initializers/omniauth.rb +7 -8
- data/lib/just_open_id/version.rb +1 -1
- data/lib/just_open_id.rb +1 -0
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README
CHANGED
@@ -1,8 +1,22 @@
|
|
1
|
-
just_open_id is a Rails 3 engine for just OpenID logins using OmniAuth
|
1
|
+
just_open_id is a Rails 3 engine for just OpenID logins using OmniAuth. It connects a OpenID account to a lightweight, locally stored User model.
|
2
2
|
|
3
|
-
The goal of this gem is to make it possible to manage accounts across multiple small apps.
|
3
|
+
The goal of this gem is to make it possible to manage accounts across multiple small apps, using as little code as possible in each respective app.
|
4
4
|
|
5
|
-
I also want to use a User model and current_user helper method in the most traditional way
|
5
|
+
I also want to use a User model and current_user helper method in the most traditional way.
|
6
|
+
|
7
|
+
Installation:
|
8
|
+
|
9
|
+
gem 'just_open_id'
|
10
|
+
rails g just_open_id
|
11
|
+
|
12
|
+
What that did:
|
13
|
+
|
14
|
+
The generator will create 3 things in your app:
|
15
|
+
1. User model subclassed to the one in the Rails engine.
|
16
|
+
2. Migration for that Rails engine User model.
|
17
|
+
3. config/initializers/just_open_id.rb
|
18
|
+
|
19
|
+
Usage:
|
6
20
|
|
7
21
|
1. Run your migrations for your namespaced User model.
|
8
22
|
2. Ensure you have a root path.
|
@@ -12,5 +26,12 @@ I also want to use a User model and current_user helper method in the most tradi
|
|
12
26
|
Welcome <%= current_user.name %>!
|
13
27
|
<%= link_to "Sign Out", signout_path %>
|
14
28
|
<% else %>
|
15
|
-
<%= link_to "Sign in with
|
29
|
+
<%= link_to "Sign in with OpenID", "/auth/open_id" %>
|
16
30
|
<% end %>'
|
31
|
+
|
32
|
+
If you like, you can change your openid_url in:
|
33
|
+
config/initializers/just_open_id.rb
|
34
|
+
|
35
|
+
Notes:
|
36
|
+
|
37
|
+
If you are looking for the route that maps "/auth/open_id", it is hard to find. It is comes as part of omniauth and does not show up in `rake routes`.
|
@@ -1,10 +1,9 @@
|
|
1
|
-
# require 'omniauth/openid'
|
2
|
-
# require 'openid/store/filesystem'
|
3
|
-
#
|
4
|
-
# use Rack::Session::Cookie
|
5
|
-
# use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new('/tmp')
|
6
|
-
|
7
1
|
require 'openid/store/filesystem'
|
2
|
+
|
8
3
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
9
|
-
|
10
|
-
|
4
|
+
# options = {}
|
5
|
+
# options[:identifier] = JustOpenId::Engine.config.openid_url if JustOpenId::Engine.config.openid_url
|
6
|
+
provider :open_id, OpenID::Store::Filesystem.new('./tmp')
|
7
|
+
end
|
8
|
+
|
9
|
+
|
data/lib/just_open_id/version.rb
CHANGED
data/lib/just_open_id.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: just_open_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jody Alkema
|