authlogic

Using authlogic_api for Rails REST API access

回眸只為那壹抹淺笑 提交于 2019-12-04 11:47:33
问题 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 models as outlined in the rdocs, but I'm not sure how to modify my ApplicationController to restrict access. Looking at the source, it appears the authlogic

what is the omniauth & email-password registration best practice?

只谈情不闲聊 提交于 2019-12-04 10:19:56
What is the best practice for combining Facebook login (let's say I'll use Omniauth gem) and email+password login? I saw a few blogs, saw the Railscasts, I know everyone is using Devise gem with Omniauth. But I'm looking for some different perspective. subquestions: I'm considering creating email+password sign-up from scratch (not using any gem for this, lets keep it fast and light) so do you have any advice for this ? Or if you have particular gem in mind, please let it be fast. And do you have any other recommendations for Oauth2 gems (alternative to Omniauth) handling authentication to

The Authlogic record method. What does this do

元气小坏坏 提交于 2019-12-04 06:57:50
I came across this method called record that Ryan bates uses in his authlogic Railscast and can't seem to understand what it does. I have been through the documentation but I can't seem to follow how that helper is useful. def current_user return @current_user if defined?(@current_user) current_user_session && current_user_session.record end What I want to know is does this simply fetch the record from the database and why is it different from the standard way of fetching data from the database. Thank you. This "record" method is a belongs_to relation between the UserSession and the User

Using Facebook Connect with Authlogic

空扰寡人 提交于 2019-12-03 14:23:39
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! Here's an example app I made using the Facebook Connect extension, authlogic and Open ID. It still needs some work, but it does function. http://big-glow-mama.heroku.com/ http://github.com/holden/authlogic_openid_selector

Configuring authlogic-oauth with google

醉酒当歌 提交于 2019-12-03 14:07:07
Howdy everybody, I am trying to learn rails, and I'm working on an app that uses Google for logins and also for calendar data. I'm currently working on configuring authlogic-oauth and having some issues. I've been following the guide for the authlogic-oauth (see link above) plugin, and I'm on steps 4 and 5. First off, I am still learning the language and I'm not sure where the code from step 4 goes in the controllers: @user_session.save do |result| if result flash[:notice] = "Login successful!" redirect_back_or_default account_url else render :action => :new end end Secondly, I'm trying to set

Authlogic's current_user object in models

蹲街弑〆低调 提交于 2019-12-03 13:00:59
I need to know the ID of the current user in a model: def after_save desc, points=nil, nil if answer_index == daily_question.correct_answer_index desc = I18n.t('daily_question.point_log.description.correct') points=daily_question.points else desc = I18n.t('daily_question.point_log.description.incorrect') end current_user.give_points(:description => desc, :points => points ) end But I guess that is not how it is done? Regards, Jacob assuming the user is loggedin you can use UserSession.find.user You might want to add checks to ensure UserSession.find returns something before calling .user It's

Rails: Authorization with Authlogic

纵饮孤独 提交于 2019-12-03 03:46:26
I need a very granular authorization system that works seamlessly with Authlogic . I've tried these gems/plugins so far: Lockdown rails _ authorization _ plugin ACL9 I've also looked at, but not tried implementing: Padlock I've searched around for a good tutorial detailing how to set up any of these with Authlogic in a way that makes sense (only the Lockdown doc seems to outline how to set this up with Authlogic), but have come up with next to nothing. The only one of these that made the remotest sense to me was the documentation for Lockdown, but I don't think that package will work for me

Rails 3 authentication with OpenID, Twitter or Facebook

倖福魔咒の 提交于 2019-12-03 01:30:55
问题 Can you suggest some working example of it? I tried Authlogic and Devise withous success. 回答1: UPDATE - June 2011 - I have been using the omniauth gem recently and I think it is a better solution than using the gems suggested in this answer. It works well with Devise and will give you everything you need in one gem. I created an engine that combines Devise and Omniauth and adds a controller to handle the callbacks. I have quite a few changes planned for the gem and right now I don't consider

Implicit user creation with Authlogic and Authlogic OAuth plugin

落爺英雄遲暮 提交于 2019-12-03 00:33:52
问题 I'm trying to write a simple OAuth consumer app in Rails. I'm using Authlogic for handling authentication and the Authlogic OAuth plugin to do the oauth thing. The oauth plugin provides a couple of helpers to render the sign in button: oauth_login_button and oauth_register_button. Together with the Authlogic logics and the plugin's request filters these two buttons somehow create the session/user. What happens next is as follows: - if I use the oauth_login_button helper, then the session

Can't put email address field on login form (Authlogic)

流过昼夜 提交于 2019-12-02 17:17:53
So I have Authlogic working fine with this user_sessions/new view: <% form_for @user_session, :url => user_session_path do |f| %> <% if @user_session.errors.present? %> Invalid username or password <% end %> <%= f.label :login %><br /> <%= f.text_field :login %><br /> <br /> <%= f.label :password %><br /> <%= f.password_field :password %><br /> <br /> <%= f.check_box :remember_me, :style => 'margin-right: 10px' %> <%= f.label :remember_me %><br /> <br /> <%= f.submit "Login" %> <% end %> But when I change <%= f.label :login %><br /> <%= f.text_field :login %><br /> to <%= f.label :email %><br