authlogic

Unit test with Authlogic on Rails 3

Hello, I would like to write some unit test with a logged user using Authlogic. To start right, I used some code hosted in http://github.com/binarylogic/authlogic_example. But I get an error after rake test, because of "test_helper.rb" and the following class: class ActionController::TestCase setup :activate_authlogic end Here is...

current_user.user_type_id = @employer ID

I am building a system with a User model (authenticated using AuthLogic) and three user types in three models: one of these models is Employer. Each of these three models has_many :users, :as => :authenticable. I start by having a new visitor to the site create their own 'User' record with username, password, which user type they are, e...

Creating a UserSession In Authlogic On the Fly

We're using authlogic, and we want to have a user accounted created and the user logged in on the fly when the user visits certain pages. We have a function that we run as the before_filter on the actions where we want the user created on the fly: # # Require user account, create an anonymous if no account # def require_user...

Rails - strange error - individual functional test files pass but when called together fail

When I run my functional tests one by one they pass with no problems. However when I run them via rake test:functionals several individual tests fail with the same error. The error is as follows NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred...

How can I force the user to fill out a captcha after a specific number of failed login attempts with authlogic?

I'm trying to secure my rails 3 app against brute force login guessing. I'm using authlogic. What's the best way to force a user (or bot) to fill out a captcha after a specific number of failed login attempts? Does authlogic have a built in mechanism for recording how many consecutive failed attempts came from the same ip? I'd appreciate...

Rails: translate ActiveRecord error template headers for a single model

Hi, I'm trying to rename the authlogic error messages in a Rails 3 app. The general format I found out working in Rails 3: de: errors: template: header: one: "Konnte {{model}} nicht speichern: ein Fehler." other: "Konnte {{model}} nicht speichern: {{count}} Fehler." body: "Bitte überprüfen Sie die...

facebook_session.user.email = nil?

I'm using authlogic_facebook_connect plugin on my RoR app. Looking to get extended permission from the user to acquire their facebook email address so that I can use this email to store in the database as their "myapp.com" registration email. This way a user can come to the site and click on the facebook connect button and be automatic...

undefined method `openid_identifier' for #<AccountSession: no credentials provided>

I am trying to get authlogic and openid happening in my app. So far its been seriously unpleasant. I have tried to follow the Railscasts on the topic but none of the gems or plugins seem to work. A after reading about a previous error I ended up installing this open-id plugin (mentioned at the bottom of that page). Now I am getting the ...

Authlogic remember_me on signup

We want to have remember_me enabled when the user signs up. When logging in its really easy to do this, how do to we do this on signup though, as we're literally only creating a User object? ...

How do I let a user sign in from a different domain on Authlogic?

[This is slightly different than a previous question about having multiple domains share the same cookie. It seemed like there wasn't an easy way to do that.] I have a application at application.com. A customer has app.customer.com pointed at my site on Heroku, and I have everything set up so that it renders a specific version of app ...

Facebook Graph API with Rails and Authlogic - preferred methodology?

There are lots of Facebook + Rails solutions, most notably Facebooker, but this and many others are not compatible with Rails 3. I'm currently using Authlogic for authentication with my app, and I want to give users the option of Facebook to sign in. I want to find the best way to have FB and Authlogic go together; right now I'm just wri...

Change Authlogic remember_me midsession

Is it possible to let the user change their remember_me status midsession? I.e. once the user is logged in non remember_me, is it possible to change to remember_me? This doesn't seem to work: # Set User Session To Remember ME Now @user_session = UserSession.find @user_session.remember_me = true ...

Migrating from clear password storage to authlogic

Hi ! I'm currently working on a Rails app which stores plain clear passwords (...). So I'm migrating to Authlogic authentication with a 'standard' SHA512 encryption. I did that which works fine : #file /models/user.rb class User < ActiveRecord::Base acts_as_authentic { |c| c.transition_from_crypto_providers = [MyOwnNoCrypto, Au...

How to get a list of online users in Authlogic?

Hey, I've added a last_request_at field to my user table in Ruby on Rails, so now I can call the authlogic method User.logged_in.count and it returns the correct value. But how do I get a list of all logged in users? Thanks for reading. ...

Ruby on Rails - request.env['HTTP_REFERER'] returns nil

Hello everyone. I am trying to save the http_referer so I can send the user back to that url after he has logged in. Right now I have a before_filter in my controllers that sends them to a log in page if a session has not been created via a redirect_to. However when I check the HTTP_REFERER it is nil (whereas 'REQUEST_URI' does return w...

Customize authlogic error message

I recently switched from restful_authentication to authlogic for authenticating users for my application. I've been exploring the API, and I've found a helper for generalizing error messages and overriding the message with my own, but I was curious as to how you can remove these two lines: 1 error prohibited this user session from ...

Rails - User Session Control using Webservice instead ActiveRecord

Hello there, I'm trying to find some cool and nice way to manage the session control of my application, just like authologic, clearance. But the issue is that I don't have a database, all the users are stored in a external webservice and the Login function is basically call the LoginDB(user,password, salt) and then it returns true or fal...

Using authlogic_api for Rails REST API access

I am writing a Rails back-end API for a Steam game that is only accessed via REST calls, so no user-specific authentication is required. I am trying to implement the authlogic_api plug-in for the Authlogic gem, which uses an api_key/signature mechanism to restrict access. I have implemented the ApplicationSession and ApplicationAccount m...

Convert Custom Auth to AuthLogic

I am trying to convert my custom simple auth system in my rails app to use AuthLogic. I have managed to get everything working fairly easily, but now when I try to login it will not properly validate my credentials. The pertinent code is below: # app/models/profile.rb class Profile < ActiveRecord::Base acts_as_authentic do |c| c.t...

getting authlogic's brute force protection to work

I'm pretty new at Ruby, Rails, and Authlogic, but I've got Authlogic installed, login in and out is fine, but I went to set up Authlogic's brute force protection feature and it won't work... Here's my app/models/user_session.rb: class UserSession < Authlogic::Session::Base consecutive_failed_logins_limit 3 failed_login_ban_for ...