Authlogic and oauth-plugin

Has anyone checked - will authlogic work with oauth-plugin ( https://github.com/pelle/oauth-plugin ) or not?

+4
source share
3 answers

The short answer is no . I am currently integrating an oauth-plugin service with my own auth system (which precedes authlogic , act_as_authenticated and all the rest).

The oauth-plugin service provider works with a code generator that generates two controllers, which are then bound to some library files in the plugin. All of these files expect a login_required class login_required with the same semantics as act_as_authenticated .

authlogic makes no assumptions about your controllers at all, so it will not work out of the box with an oauth-plugin , however this design decision also means that it will be quite easy to structure the controllers in the expected way. Therefore, it should be (perhaps trivial) easy to build a gasket to support the oauth-plugin .

However, in my case, I decided to start the generator in order to extract what I need from the plugin and remove the plugin itself. The main reason I do this is because I obviously do not use the login_required method on my auth system, so I would have to decapitate the lib patch to make it work. Secondly, the plugin has a lot of things that I don’t need. Thirdly, most of the materials that are really at the library level have already been abstracted in the oauth style itself , so the material in the oauth-plugin lib directory is in this strange no land between the generated code and the actual library.

+2
source

I am working on it now. I just flipped my own using authlogic methods to make it play well. (I'm trying to get the provider to work, so authlogic-oauth is not suitable for me)

I will edit when I go

 def logged_in? return true if current_user end def login_required return true if logged_in? store_location redirect_to new_user_session_path and return false end 
+2
source

Authlogic has an add-in that was specifically designed for it, which can be found here .

+1
source

All Articles