authlogic

Rails, OpenID and Authlogic

I've been following ryan baytes screencast #170 and adding ruby-openid, authlogic and authlogic-oid to an existing authlogic authentication system. However, i keep getting the following stack of errors: NameError (uninitialized constant OpenIdAuthentication::InvalidOpenId): /Library/Ruby/Gems/1.8/gems/authlogic-oid-1.0.4/lib/authlo...

Bizarre authlogic issue only in Production

Context: A rails app with authlogic for sigup and login Setup info: Rails 2.3.2 A controller called posts with an action 'show'. Upon login, I display the posts/index page. and when the user clicks on an item, item's details get displayed. Fairly standard stuff. All of this works fine and dandy both in Development and Production (Ap...

Authlogic openid: getting undefined method openid_identifier? error in functional test

I use Authlogic with the Authlogic-openid addon (I gem installed ruby- openid and script/plugin install git://github.com/rails/open_id_authentication.git) and get two errors. First when running functional test, I get an undefined method openid_identifier? message on a line in my new.html.erb file when running the UsersControllerTe...

Authlogic authorization equivalent of restful_authentication

Say I have a simple todo app and I want the users to see only their todos. I'm having trouble authorizing with Authlogic. In restful_authentication, I just do def index @post = current_user.posts.find.all end But I'm unable to do that with authlogic. I looked into declarative_authorization, but still can't get it to work. I want th...

Ruby on Rails: how can I store additional data in the session for authlogic

I'm using Authlogic to authenticate users. I understand how to create and use sessions, but want to store an additional id variable in the current_user session created by authlogic. Can I just do something like this: session[:authlogic_sess_name] = @extra_id.id However, I'm not sure what the authlogic session is named though or ho...

Issue with accepts_nested_attributes_for while using authlogic_oauth

I have the following models: class Merchant acts_as_authentic has_one :store accepts_nested_attributes_for :store end class Store belongs_to :merchant end I am using authlogic_oauth gem for Twitter authentication. While registration I save the Merchant and the Store model. If I disable the oauth authentication both models are...

Facebooker install on Windows

Hey guys, I'm trying to install facebooker using: gem install facebooker on my Win7 machine. It returns this: checking for ruby/st.h... * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configu...

Access recovery mechanism if site only supports OpenID login

Say I have a site, like StackOverflow, which supports OpenID login only. Suppose someone had an account on the site, bound to his OpenID, and then he lost access to his OpenID provider (that's surely possible and not harder than losing your email password). How would he then restore access to his account? I see two options: one is the u...

Force validation of blank passwords in Authlogic

I'm adding a password reset feature to my Rails application that uses Authlogic. I was following the guide here: http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic/ and everything works as I'd like except for one thing: the password reset form accepts blank passwords and simply doesn't change them. I've been s...

URL encoded route to Rails controller

I have a URL encoded resource such as: http://myurl/users/Joe%20Bloggs/index.xml This is for a RESTful webservice which uses user logins in the path. The problem is that the controller in rails doesn't seem to decode the %20. I get the following error: ActionController::RoutingError (No route matches "/Joe%20Bloggs/index.xml" with {...

bizarre Facebook connect with authlogic problem

I set up a Facebook connecе to my application following the http://github.com/holden/authlogic_openid_selector_example. But I have a strange problem with Facebook Connect on Firefox and Google Chrome browsers, it just will not allow me to authenticate. But on Safari it works perfectly. ...

Passing hidden invitation token field after being redirected from openid authorization

I'm trying to combine Ryan Bates' Beta invitations and Open id. The way it is setup is so that signup form has hidden field, invitation token that allows user to sign up. The invitation token is sent in url: /signup/:invitation_token However when I use open_id, it redirects back to just /signup url without the invitation token. How do I...

validating password format in Authlogic

Is there a way to get Authlogic to validate the format of a password, for instance must contain at least one letter and at least one number? The omission of a validates_format_of_password_options method to be used in the acts_as_authentic config block seems to indicate that Authlogic has the opinion that one should not be imposing such ...

Authlogic with activations - nesting the User sign up form not working

Hi I have Authlogic with activation emails being sent working just fine. The problem is I would like to next this user sign up form in a larger account form. It seems that when I do this the user information is put in just fine however the User create does not trigger the @user.signup! when nested into a form. Any ideas on why or wha...

Ruby on rails - Authlogic : periodically check if user session is valid

Hi, I'm looking for a solution allowing me to check periodically if the user session has expired and if so redirect him to the login page. I'm using Authlogic gem, so what I'm doing is call a function that make a test on current_user. My USER_SESSION_TIMEOUT is 5minutes so I make this ajax call every 5:10 minutes. <%= periodically_ca...

How to use authlogic to restrict access to static files/documents (such as .PDF)

I have a very simple Ruby on Rails app which uses acts_as_solr plugin to index and search PDF files. The basic idea of the app is: all PDF files located in myRoRapp/public/PDFfiles/example.pdf are full-text search-able. Usage of the webapp returns links to all PDFs that meet the search criteria. The app is user authenticated using nift...

Authlogic Help! Registering a new user when currently logged-in as a user not working.

Hi Just as a disclaimer I am new to rails and programming in general so apologize for misunderstanding something obvious. I have Authlogic with activation up and running. So for my site I would like my users who are logged in to be able to register other users. The new user would pick their login and password through the activation ema...

Authlogic: logging-in twice on the same test

Is there any way to logout and login another user when testing with Authlogic? The following test case just fails class MessagesControllerTest < ActionController::TestCase setup :activate_authlogic should "sender send a message and recipient delete it" do @sender = Factory(:user, :login => 'sender') @recipient = Factory(:u...

How do I write and test password changes when using Authlogic?

An application I inherited has the following action for updating a user's profile: class UsersController < ApplicationController # ... def update @user = current_user if @user.update_attributes(params[:user]) flash[:notice] = "Successfully updated profile." redirect_to root_url else flash[:error] = "Hrm...

Authlogic: Bypass model validation if user is logged in

I'm using Authlogic. I've got an Entry model and there is a validation method that I want to skip if the request was made by a logged in user (anonymous users are also allowed to create entries). I assume that UserSession.find would not be usable from inside the Entry model like it is from a controller. What is the best way to handle thi...