just_open_id 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- just_open_id (0.0.1)
4
+ just_open_id (0.0.3)
5
5
  omniauth
6
6
 
7
7
  GEM
data/README CHANGED
@@ -1,8 +1,22 @@
1
- just_open_id is a Rails 3 engine for just OpenID logins using OmniAuth that connects to a User model.
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 in each app.
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 Twitter", "/auth/twitter" %>
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
- provider :open_id, OpenID::Store::Filesystem.new('/tmp'), :identifier => JustOpenId::Engine.config.openid_url
10
- end
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
+
@@ -1,3 +1,3 @@
1
1
  module JustOpenId
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/just_open_id.rb CHANGED
@@ -4,6 +4,7 @@ module JustOpenId
4
4
 
5
5
  # This engine is intended to run as a gem.
6
6
  # The lib below will be installed via gem dependencies.
7
+ # TODO: Get rid of this
7
8
  begin
8
9
  require "omniauth"
9
10
  rescue LoadError => e
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jody Alkema