authlogic

authlogic and oauth-plugin

三世轮回 提交于 2019-12-05 12:33:07
does somebody tested - will authlogic works with oauth-plugin ( https://github.com/pelle/oauth-plugin ) or not? The short answer is no . I am currently integrating oauth-plugin 's service providership with my own auth system (which predates authlogic , acts_as_authenticated and all the rest). oauth-plugin service providership works by means of a code generator generating two controllers, which are then tied into some library files in the plugin. All of these files expect a login_required class method with the same semantics that acts_as_authenticated uses. authlogic makes no assumptions about

Protecting Content with AuthLogic

落花浮王杯 提交于 2019-12-05 12:12:01
I know this sounds like a really, really simple use case and I'm hoping that it is, but I swear I've looked all over the place and haven't found any mention of any way - not even the best way - of doing this. I'm brand-spanking new to Ruby, Rails and everything surrounding either (which may explain a lot ). The dummy app that I'm using as my learning tool requires authentication in order to do almost anything meaningful, so I chose to start by solving that problem. I've installed the AuthLogic gem and have it working nicely to the extent that is covered by the intro documentation and Railscast

validating password format in Authlogic

故事扮演 提交于 2019-12-05 07:51:44
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 a constraint on one's users. I thought I would simply put in a normal ActiveRecord validates_format_of :password , but this means that a current_user object I build is inherently invalid, as I can't retrieve the plaintext password (and wouldn't be storing it in

How can I use mock models in AuthLogic controller specs?

家住魔仙堡 提交于 2019-12-05 00:54:36
问题 I am trying to write specs for a controller without using fixtures (instead employing mock models). This controller requires a user to be logged in, for which I'm employing AuthLogic, following the author's recommendations. describe UsersController do def mock_user(stubs={}) @mock_user ||= mock_model(User, stubs) end context 'when logged in' do before { activate_authlogic } it "exposes the logged-in user as @user in response to GET (show)" do UserSession.create(mock_user) ... end ... end ...

Using Facebook Connect with Authlogic

我只是一个虾纸丫 提交于 2019-12-04 22:15:03
问题 I am trying to make Authlogic and Facebook Connect (using Facebook) play nice so that you can create an account either the normal registration way or with Facebook connect. I have been able to get the connect to work one way but logging out only loggs out on facebook and not on my site, I have to delete the cookies to make it working. Any help would be awesome, thank you! 回答1: Here's an example app I made using the Facebook Connect extension, authlogic and Open ID. It still needs some work,

Problem with Authlogic and Unit/Functional Tests in Rails

陌路散爱 提交于 2019-12-04 19:41:48
I'm learning how unit testing is done in Rails, and I've run into a problem involving Authlogic. According to the Documentation there are a few things required to use Authlogic stuff in your tests: test_helper.rb: require "authlogic/test_case" class ActiveSupport::TestCase setup :activate_authlogic end Then in my functional tests I can login users: UserSession.create(users(:tester)) The problem seems to stem from the setup :activate_authlogic line in test_helper.rb, whenever that is included, I get the following errors when running functional tests: NoMethodError: undefined method `request='

Authlogic: How to block certain IP addresses from signing up?

為{幸葍}努か 提交于 2019-12-04 18:16:41
Using authlogic in a rails app, I want to prevent users from certain IP addresses to sign up (because of misuse). What would be the proper way to do that? class SignupsController < ApplicationController before_filter :block_ip_addresses protected def block_ip_addresses head :unauthorized if current_ip_address == "XX.XX.XX.XX" end def current_ip_address request.env['HTTP_X_REAL_IP'] || request.env['REMOTE_ADDR'] end end 来源: https://stackoverflow.com/questions/10894408/authlogic-how-to-block-certain-ip-addresses-from-signing-up

using authlogic to auto create users bypassing explicit user registeration

自古美人都是妖i 提交于 2019-12-04 17:20:34
I'm wondering how to go about using Authlogic to auto register a user who chooses to use open id. Right now they have to register first before being able to login in, even if they choose open id, but I'd prefer if they could just login directly provided I get all the necessary details from the open id provider. But I'm not sure how to go about doing this? Would I do it inside my user session controller or is there some fancy way to extend authlogic inside the model? If someone could point me in the right the direction, i'd be grateful. Here's an example of what I have now with the two pages:

devise routing error

倖福魔咒の 提交于 2019-12-04 13:28:41
I can't seem to get past this error when setting up devise. Routing Error wrong constant name Devise/registrationsController or Routing Error wrong constant name Devise/sessionsController I'm using Ruby 1.8.7, Rails 3.0 and Devise 1.1.3 Everything else on my app works, I recently upgraded my app from 2.3.8 and was previously using authlogic but didn't have any users other than myself so I just jettisoned my User, Session models and User, UserSession controllers... so I'm figuring that has something do to with it because I made a new Rails 3 app to test devise on my configuration and the

Problem with sessions, subdomains and authlogic in Rails

时间秒杀一切 提交于 2019-12-04 11:55:48
I've got a rails app with authlogic authentication and a username.domain.com structure built with subdomain-fu. But my session breaks when going from domain.com to username.domain.com. I've tried to add config.action_controller.session = {:domain => '.localhost:3000'} to my development.rb but that seams to break authlogic disabling sign out/sign in. Any suggestions on what to do? Thanks in advance! you are having this issue in the development mode but probably wont have this issue in prod mode.. you are trying to set the top level cookie. your browser wont let you do that. what you are trying