authlogic

Rails: Basic Authentication with Authlogic

不羁岁月 提交于 2019-11-28 01:40:33
问题 I'm using Authlogic and I would like to implement Basic HTTP Authentication in my controller so I could define which action requires authentication. I know how to do Basic HTTP Authentication authenticate_or_request_with_http_basic an before_filter, but I would like to here from other how to implement it with Authlogic plugin. class ItemsController < ApplicationController before_filter :authenticate , :only => [:index, :create] ... end 回答1: Here is a great screencast that explains, step-by

Authlogic and multiple sessions for the same user

▼魔方 西西 提交于 2019-11-27 18:18:59
问题 I'm using Authlogic to manage the sessions in my application. However, by default, authlogic allows a user to be logged in many times from different computers. I don't want that (the user pays to get access and I want to avoid users sharing their accounts). Looking in the Authlogic documentation, I've found about the perishable_token . But when trying to implement it, I just get an error saying the persistence_token is required (when it shouldn't be as I use the perishable one). How would you

Integration testing with Authlogic?

妖精的绣舞 提交于 2019-11-27 15:03:24
问题 For the life of me I don't understand why Authlogic isn't logging me in in this integration test. I haven't had any problems w/ Authlogic logging me in in functional tests using this code. According to the authlogic rdocs (http://tinyurl.com/mb2fp2), simulating a logged-in state is the same in functional & integration tests, so i'm pretty confused. any help is MUCH appreciated! class TipsController < ApplicationController before_filter :require_user, :only => [:destroy, :undelete] def destroy

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

∥☆過路亽.° 提交于 2019-11-27 06:07:58
问题 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 where Im originally coming from). Thank you. 回答1: HTTP_REFERER is an HTTP header set by the browser in the request containing the the address of the previous web page from

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

两盒软妹~` 提交于 2019-11-25 22:36:30
问题 I am using Authlogic-Connect for third party logins. After running appropriate migrations, Twitter/Google/yahoo logins seem to work fine but the facebook login throws exception: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed The dev log shows OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed): app/controllers/users_controller.rb:37:in `update\' Please suggest.. 回答1: I ran