ruby-openid 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby-openid might be problematic. Click here for more details.

data/examples/consumer.rb CHANGED
@@ -6,9 +6,13 @@ require "pathname"
6
6
  require "webrick"
7
7
  include WEBrick
8
8
 
9
- require "openid/consumer"
10
- require "openid/filestore"
11
- require "openid/util"
9
+ # load the openid library, first trying rubygems
10
+ begin
11
+ require "rubygems"
12
+ require_gem "ruby-openid", ">= 1.0"
13
+ rescue LoadError
14
+ require "openid"
15
+ end
12
16
 
13
17
  ################ start config ##########################
14
18
  # use your desired store implementation here
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ handle: {HMAC-SHA1}{44637c57}{YcwFSQ==}
3
+ secret: N2o4OrdrEhtke+lcpAOwOQaffGU=
4
+ issued: 1147370327
5
+ lifetime: 1209599
6
+ assoc_type: HMAC-SHA1
@@ -4,7 +4,7 @@ A store is required by an OpenID server and optionally by the consumer to
4
4
  store associations, nonces, and auth key information across requests and
5
5
  threads. This directory contains code useful in implementing an
6
6
  ActiveRecord based store as an alternative to using the standard
7
- OpenID::FilesystemOpenIDStore in Ruby on Rails applications.
7
+ OpenID::FilesystemStore in Ruby on Rails applications.
8
8
 
9
9
  ==Setting up your database
10
10
 
@@ -36,7 +36,7 @@ openid_setting.rb into the app/models dir of your rails app.
36
36
  You'll probably have controller for handling openid operations in your
37
37
  application (see the other examples). The control flow of the store
38
38
  is handled in a helper. Look at OpenidHelper in openid_helper.rb,
39
- which implements the OpenID::OpenIDStore interface.
39
+ which implements the OpenID::Store interface.
40
40
 
41
41
  Copy the openid_helper.rb into your app/helpers and then include the
42
42
  OpenidHelper module in your openid controller. When instantiating
@@ -1,4 +1,9 @@
1
- require 'openid/association'
1
+ begin
2
+ require "rubygems"
3
+ require_gem "ruby-openid", ">= 1.0"
4
+ rescue LoadError
5
+ require "openid"
6
+ end
2
7
 
3
8
  class OpenidAssociation < ActiveRecord::Base
4
9
 
@@ -1,4 +1,10 @@
1
- require 'openid/association'
1
+ # load the openid library
2
+ begin
3
+ require "rubygems"
4
+ require_gem "ruby-openid", ">= 1.0"
5
+ rescue LoadError
6
+ require "openid"
7
+ end
2
8
 
3
9
  module OpenidHelper
4
10
 
@@ -1,8 +1,13 @@
1
1
  require "pathname"
2
2
  require "cgi"
3
3
 
4
- require "openid/filestore"
5
- require "openid/consumer"
4
+ # load the openid library
5
+ begin
6
+ require "rubygems"
7
+ require_gem "ruby-openid", ">= 1.0"
8
+ rescue LoadError
9
+ require "openid"
10
+ end
6
11
 
7
12
  class <%= class_name %>Controller < ApplicationController
8
13
  layout 'scaffold'
@@ -15,19 +20,13 @@ class <%= class_name %>Controller < ApplicationController
15
20
  if @request.post?
16
21
  request = consumer.begin(openid_url)
17
22
 
18
- p 'XXX', request
19
-
20
23
  case request.status
21
24
  when OpenID::SUCCESS
22
25
  return_to = url_for(:action=> 'complete')
23
26
  trust_root = url_for(:controller=>'')
24
27
 
25
28
  url = request.redirect_url(trust_root, return_to)
26
- p 'REDIRECTURL', url
27
-
28
29
  redirect_to(url)
29
-
30
- p 'REDIRECT SENT', @session
31
30
  return
32
31
 
33
32
  when OpenID::FAILURE
@@ -40,8 +39,6 @@ class <%= class_name %>Controller < ApplicationController
40
39
  end
41
40
  end
42
41
 
43
- p 'Done'
44
-
45
42
  end
46
43
 
47
44
  # handle the openid server response
@@ -1,7 +1,12 @@
1
1
  require 'pathname'
2
2
 
3
- require 'openid/filestore'
4
- require 'openid/server'
3
+ # load the openid library, first trying rubygems
4
+ begin
5
+ require "rubygems"
6
+ require_gem "ruby-openid", ">= 1.0"
7
+ rescue LoadError
8
+ require "openid"
9
+ end
5
10
 
6
11
  class ServerController < ApplicationController
7
12
 
@@ -6057,3 +6057,28 @@ Processing ServerController#index (for 127.0.0.1 at 2006-05-09 14:00:54) [GET]
6057
6057
  Parameters: {"openid.return_to"=>"http://localhost:2000/complete?&nonce=vh0B1ozF", "openid.mode"=>"checkid_setup", "action"=>"index", "controller"=>"server", "openid.identity"=>"http://localhost:3000/user/x", "openid.trust_root"=>"http://localhost:2000/", "openid.assoc_handle"=>"{HMAC-SHA1}{44610305}{DjH4ig==}"}
6058
6058
  Redirected to http://localhost:2000/complete?&nonce=vh0B1ozF&openid.sig=QbSO14Ca39098XwN38yXb%2BNgiDc%3D&openid.mode=id_res&openid.return_to=http%3A%2F%2Flocalhost%3A2000%2Fcomplete%3F%26nonce%3Dvh0B1ozF&openid.identity=http%3A%2F%2Flocalhost%3A3000%2Fuser%2Fx&openid.signed=identity%2Creturn_to%2Cmode&openid.assoc_handle=%7BHMAC-SHA1%7D%7B44610305%7D%7BDjH4ig%3D%3D%7D
6059
6059
  Completed in 0.00412 (242 reqs/sec) | 302 Found [http://localhost/server?openid.mode=checkid_setup&openid.return_to=http%3A%2F%2Flocalhost%3A2000%2Fcomplete%3F%26nonce%3Dvh0B1ozF&openid.trust_root=http%3A%2F%2Flocalhost%3A2000%2F&openid.identity=http%3A%2F%2Flocalhost%3A3000%2Fuser%2Fx&openid.assoc_handle=%7BHMAC-SHA1%7D%7B44610305%7D%7BDjH4ig%3D%3D%7D]
6060
+
6061
+
6062
+ Processing LoginController#index (for 127.0.0.1 at 2006-05-11 11:01:05) [GET]
6063
+ Parameters: {"action"=>"index", "controller"=>"login"}
6064
+ Rendering within layouts/server
6065
+ Rendering login/index
6066
+ Completed in 0.00734 (136 reqs/sec) | Rendering: 0.00612 (83%) | 200 OK [http://localhost/]
6067
+
6068
+
6069
+ Processing LoginController#submit (for 127.0.0.1 at 2006-05-11 11:01:08) [GET]
6070
+ Parameters: {"username"=>"b", "action"=>"submit", "controller"=>"login"}
6071
+ Redirected to http://localhost:3000/
6072
+ Completed in 0.00144 (692 reqs/sec) | 302 Found [http://localhost/login/submit?username=b]
6073
+
6074
+
6075
+ Processing LoginController#index (for 127.0.0.1 at 2006-05-11 11:01:09) [GET]
6076
+ Parameters: {"action"=>"index", "controller"=>"login"}
6077
+ Rendering within layouts/server
6078
+ Rendering login/index
6079
+ Completed in 0.00211 (474 reqs/sec) | Rendering: 0.00098 (46%) | 200 OK [http://localhost/]
6080
+
6081
+
6082
+ Processing ServerController#index (for 127.0.0.1 at 2006-05-11 11:01:18) [GET]
6083
+ Parameters: {"action"=>"index", "controller"=>"server"}
6084
+ Completed in 0.00290 (344 reqs/sec) | 200 OK [http://localhost/server]
data/lib/openid.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "openid/util"
2
+ require "openid/consumer"
3
+ require "openid/server"
4
+ require "openid/stores"
5
+ require "openid/filestore"
@@ -5,7 +5,7 @@ require "openid/parse"
5
5
  # try and use the yadis gem, falling back to system yadis
6
6
  begin
7
7
  require 'rubygems'
8
- require_gem 'ruby-yadis', ">=0.2.3"
8
+ require_gem 'ruby-yadis', ">=0.3"
9
9
  rescue LoadError
10
10
  require "yadis"
11
11
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: ruby-openid
5
5
  version: !ruby/object:Gem::Version
6
- version: "1.0"
7
- date: 2006-05-10 00:00:00 -07:00
6
+ version: 1.0.1
7
+ date: 2006-05-11 00:00:00 -07:00
8
8
  summary: A library for consuming and serving OpenID identities.
9
9
  require_paths:
10
10
  - lib
@@ -12,7 +12,7 @@ email: brian@janrian.com
12
12
  homepage: http://www.openidenabled.com/openid/libraries/ruby
13
13
  rubyforge_project:
14
14
  description:
15
- autorequire:
15
+ autorequire: openid
16
16
  default_executable:
17
17
  bindir: bin
18
18
  has_rdoc: true
@@ -156,12 +156,14 @@ files:
156
156
  - examples/openid-store/temp
157
157
  - examples/openid-store/auth_key
158
158
  - examples/openid-store/associations/http-localhost_3A3000_2Fserver-EMQbAy3NnHVzA.s0u5KAcplKGzo
159
+ - examples/openid-store/associations/http-www.myopenid.com_2Fserver-ZFp96P4qV1FjqgGt2rtZBvRJWic
159
160
  - lib/openid
160
161
  - lib/hmac-sha2.rb
161
162
  - lib/hmac.rb
162
163
  - lib/hmac-sha1.rb
163
164
  - lib/hmac-rmd160.rb
164
165
  - lib/hmac-md5.rb
166
+ - lib/openid.rb
165
167
  - lib/openid/consumer.rb
166
168
  - lib/openid/dh.rb
167
169
  - lib/openid/fetchers.rb