binarylogic / authlogic_openid Goto Github PK
View Code? Open in Web Editor NEWExtension of the Authlogic library to add OpenID support.
Home Page: http://authlogic-oid.rubyforge.org
License: MIT License
Extension of the Authlogic library to add OpenID support.
Home Page: http://authlogic-oid.rubyforge.org
License: MIT License
Can this Github repos be turned into gem? Now I only seem to find the 1.0.4 version :(
Also I get a 'nil.params?' error when using in console / test.
Please see below for fix:
# This fixes the following error:
# You have a nil object when you didn't expect it!
# The error occurred while evaluating nil.params
module AuthlogicOpenid
module ActsAsAuthentic
module Methods
def openid_complete?
session_class.controller && session_class.controller.params[:open_id_complete] && session_class.controller.params[:for_model]
end
end
end
end
There haven't been any commits since June.
Am I missing something? Is there a different gem, or a fork of this one that gets fixed more often?
In the validate_by_openid method, you're setting the variable "self.remember_me", while a few lines below, you're using "remember_me?" (notice the question mark).
I'm not completely sure if this is a typo/bug, but it looks like it. Sorry if I'm wrong.
Does OpenID have a session expiration on it? I'm finding in a sample app built on this gem that inactivity for 10 or 20 minutes logs me out.
Thanks!
I originally posted this as a AuthLogic Lighthouse ticket, so I'll simply include a link to the ticket.
Note that I found the cause of the problem and propose a possible solution in my second to last post in the ticket.
Authlogic-Changelog for 2.0.12 released 2009-5-13 reads:
Changed config() convenience method to rw_config() to be more descriptive and less vague.
...but methods 'required_fields' and 'optional_fields' in 'lib/authlogic_openid/acts_as_authentic.rb' still use config().
This results in a NoMethodError for people using authlogic-openid in combination with authlogic >= 2.0.12.
Haven't had a chance to see if this is a discovery problem or what, but http://josephholsten.com consistently fails to authenticate through authlogic_openid. And I'm quite certain that OpenID is correctly configured.
Can you make this available as a gem from github?
Hi,
since open_id_authentication is now build on top of Rack::OpenID, the gem is not working anymore.
Here the changes i found for now.
the exception class OpenIdAuthentication::InvalidOpenId was removed as well as the method OpenIdAuthentification.normalize_identifier
These are use in
def openid_identifier=(value)
write_attribute(:openid_identifier, value.blank? ? nil : OpenIdAuthentication.normalize_identifier(value))
reset_persistence_token if openid_identifier_changed?
rescue OpenIdAuthentication::InvalidOpenId => e
@openid_error = e.message
end
def openid_identifier=(value)
@openid_identifier = value.blank? ? nil : OpenIdAuthentication.normalize_identifier(value)
@openid_error = nil
rescue OpenIdAuthentication::InvalidOpenId => e
@openid_identifier = nil
@openid_error = e.message
end
undefined method `required_fields=' !!
It would be nice if it supports more than one OpenID per user, so people can enter alternative ones.
Is there a way to alter the table name used?
Or can the code be changed to quote the session table?
ActiveRecord::StatementInvalid (OCIError: ORA-00903:
invalid table name: SELECT data FROM session WHERE id = 3 FOR UPDATE)
ActionView::Template::Error ("DESC session" failed; does it exist?)
Thanks,
On a new project, while trying to setup Authlogic and Authlogic OpenId I constantly run into that exception, which in turn unables me to create users / login users.
I'm using Rails 2.3.5 with the following gems:
config.gem 'authlogic', :version => '2.1.3'
config.gem 'rack-openid', :version => '0.2.2', :lib => 'rack/openid'
config.gem 'ruby-openid', :version => '2.1.7', :lib => 'openid'
config.gem 'authlogic-oid', :version => '1.0.4', :lib => 'authlogic_openid'
I'm also using the latest version of rails/open_id_authentication plugin.
Anyone could provide me with some assistance / guide me in the right direction on how to tackle this problem?
Best regards,
DBA
For the validates_length_of_password_field_options, validates_confirmation_of_password_field_options, and validates_length_of_password_confirmation_field_options the :if option is ignored. It appears that a merge is executed against the options hash, overwriting the :if option. Can we change this to a reverse_merge? http://gist.github.com/251422
(I wanted to run this against the test suite but I couldn't get the suite to pass regardless of this patch's presence)
authlogic 2.1.1 and authlogic-oid 1.0.4
When I try and register a new openid user I get the following error: http://pastie.org/534201
The source code for the app in question is here: http://github.com/rurounijones/opensource-country/tree/master
I am sure this was working before and no changes have been made to the code in question apart from the update to the gems.
Hi there,
I need help writing the create() method in the users_controller.
So perhaps this could label this as a "documentation bug".
Anyway, in my users controller, I wrote this:
def create
@user = User.new(params[:user])
debugger
@user.save do |result|
if result
flash[:notice] = "Account registered!"
redirect_back_or_default account_url
else
render :action => :new
end
end
end
When control hits
@user.save do |result|
control transfers to this file:
http://github.com/binarylogic/authlogic_openid/blob/master/lib/authlogic_openid/acts_as_authentic.rb
then to this line:
def save(perform_validation = true, &block)
return false if perform_validation && block_given? && authenticate_with_openid? && !authenticate_with_openid
Once here, the debugger is telling me that block_given? is false.
This is wrong.
block_given? should be true.
So, perhaps I wrote create() incorrectly?
The doc only gives syntax for the saving of UserSession objects.
Please offer clues.
Thanks,
--Audrey
when do we get an update on rubyforge for the gem?
i'm missing the auto_register function in the gem.
thx daq
Hi. It would be very nice if it was possible to merge the login and registration together. Example:
As a user who never used the website.
When I login with openid.
The user is automatically created.
This way, I don't have a registration phase. The user simple logins, and if it doesn't exist yet on the database, the user is created.
I tried to play with the existing code to implement this behavior with no success. Does it make sense?
authlogic v2.0.13 and authlogic-oid v1.0.4
When I submit an invalid open id to a new session ("goodopenid.com" in my case) I get the following error:
Missing template user_sessions/create.erb in view path app/views
Here's my user_sessions_controller create method (copied from examples)
def create
@user_session = UserSession.new(params[:user_session])
# We are saving with a block to accomodate for OpenID authentication
# If you are not using OpenID you can save without a block:
#
# if @user_session.save
# # ... successful login
# else
# # ... unsuccessful login
# end
@user_session.save do |result|
if result
flash[:notice] = "Login successful!"
redirect_back_or_default root_path
else
render :action => :new
end
end
end
For some reason its attempting to render "create" rather than rendering "new" with errors.
Incidentally, I see the same problem in the sample app here:
http://authlogicexample.binarylogic.com/
There, when I use "goodopenid.com" I get a crash.
Ideas?
So I followed the railscast tutorial and used the old version of the plugin from Ryan's git file. I can now successfuly create/register a user using OpenID (Google), but I cannot log in with this user. When I submit the OpenID that has been registered, I get "uninitialized constant Rack::OpenID". Any ideas?
Thanks!
It seems quite complicated to make login (using auto_register) work without forcing user to enter a password. I won't do any hacks as of not validating/requiring password fields, since those are still needed with old school login/password registration/login.
What would I expect is that authlogic_openid let me register users without password and login/username/email
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.