authlogic

Current_user nil after creating a session in ROR with AuthLogic

家住魔仙堡 提交于 2019-12-10 16:00:00
问题 I'm having a bit of problems with AuthLogic and current_user. I have a Flex4 application using the Cairngorm framework as the front-end, and Ruby On Rails as the back-end. I can log in fine through a browser, and when only using ROR. However, when I try it through my Flex4 application, it will fail the first time but work the second time. What is happening, is inside the user_sessions_controller.rb I have a call to self.current_user.to_xml; The first time I call the create action, the current

#<UserSession: {:unauthorized_record=>“<protected>”}>

与世无争的帅哥 提交于 2019-12-08 17:39:44
问题 I'm trying to build a "just click on your name to login" system using auth_logic. My user model has an email and name field. To login, I simply do: UserSession.create(@user, true) Unfortunately that doesn't result in a session being created. Using a debugger I found this message: #<UserSession: {:unauthorized_record=>"<protected>"}> My user model just has one line: acts_as_authentic User session line has this, which I found somewhere. I'm not sure what it does and I've tried with and without:

Unit testing with Authlogic in Rails 3.2

假装没事ソ 提交于 2019-12-08 09:35:36
问题 Authlogic seems to be messing up my unit tests. When I try to run any unit test, I get: authlogic/acts_as_authentic/base.rb:31:in `acts_as_authentic': You must establish a database connection before using acts_as_authentic (StandardError) It doesn't matter what my unit test is. Even if all my unit test file contains is require 'test_helper' , I still get the error. This, of course, tells me that the problem is probably in my test/test_helper.rb file. Here's my test/test_helper.rb (based on

Create a new user with new openid login authlogic

给你一囗甜甜゛ 提交于 2019-12-08 07:07:07
问题 I've implemented authlogic in a rails site, and I'm trying to get openid to work correctly. So far, you can login just fine as long as you have an existing account, but not so much if you don't. I'd like to be able to automagically create a new account if the identity_url is not already in the database. The problem is that I also need to store some additional info. if the user is logging in for the first time with their openid, I'd like to ask them to fill in basic info (name, email), BEFORE

Rails authlogic password hashing algorithm using ruby only

不问归期 提交于 2019-12-08 04:32:36
问题 Does anyone know how I'd run plain text passwords through the authlogic hasing algorithm without using rails? It looks like the default for authlogic is sha512. I have a database of plain text passwords (yes, I know... bad) and need to import them into a new DB that uses the authlogic setup. This ruby script is outside of rails so I don't want to use the rails based authlogic commands. I have require 'authlogic' in the ruby script I'm new to ruby modules but was trying to call the password

Rails authlogic password hashing algorithm using ruby only

99封情书 提交于 2019-12-08 04:14:21
Does anyone know how I'd run plain text passwords through the authlogic hasing algorithm without using rails? It looks like the default for authlogic is sha512. I have a database of plain text passwords (yes, I know... bad) and need to import them into a new DB that uses the authlogic setup. This ruby script is outside of rails so I don't want to use the rails based authlogic commands. I have require 'authlogic' in the ruby script I'm new to ruby modules but was trying to call the password method like: Authlogic::ActsAsAuthentic::Password::Methods::InstanceMethods.password('password_here') I

Why I'm getting undefined method `cookies'?

空扰寡人 提交于 2019-12-08 03:27:51
问题 I'm trying to setup Authlogic with single_access_token for my rails backend app (I'm using rails-api gem). I'm following this example: http://blog.centresource.com/2013/06/04/using-ember-auth-with-rails-3-and-authlogic/ So far, I'm able to create users, but when I try to login it fails on user_session.save : NoMethodError in Api::V1::UserSessionsController#create undefined method `cookies' for #<Api::V1::UserSessionsController:0x00000004528cb8> According to similar questions I've found here,

Rails and Authlogic: Allow only one session per user?

邮差的信 提交于 2019-12-07 17:29:52
问题 Is there a way to limit the number of sessions in Ruby on Rails application (I'm using Authlogic for authentication)? I would like to allow only 1 session per user account. When the same user is logging on another computer the previous session should be expired/invalidated. I was thinking about storing the session data in database and then deleting it when a new session instance is created but probably there is an easier way? (configuration option) 回答1: I just ran into a possible solution, if

Create a new user with new openid login authlogic

。_饼干妹妹 提交于 2019-12-07 15:59:37
I've implemented authlogic in a rails site, and I'm trying to get openid to work correctly. So far, you can login just fine as long as you have an existing account, but not so much if you don't. I'd like to be able to automagically create a new account if the identity_url is not already in the database. The problem is that I also need to store some additional info. if the user is logging in for the first time with their openid, I'd like to ask them to fill in basic info (name, email), BEFORE the account is created. I've played around with a few methods, but nothing seems to be working. Thanks

authlogic and oauth-plugin

我的梦境 提交于 2019-12-07 09:03:02
问题 does somebody tested - will authlogic works with oauth-plugin (https://github.com/pelle/oauth-plugin) or not? 回答1: 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