views:

602

answers:

2

Hi all does somebody tested - will authlogic works with oauth-plugin (https://github.com/pelle/oauth-plugin) or not?

+2  A: 

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

Mike Trpcic
i need plugin to make oauth server, but not to allow users to login using credentials from third party site thru oauth protocol
Alexey Poimtsev
oauth-plugin by pelle works great with restful-authentication, but i'd like to know - will it works with authlogic or not
Alexey Poimtsev
huh .. i need to make authlogic-enabled site as provider, but not consumer
Alexey Poimtsev
+1  A: 

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 your controllers at all, so it won't work out of the box with oauth-plugin, however that design decision also means it will be fairly easy to structure your controllers in the expected way. Therefore it should be (maybe trivially) easy to build a shim to support oauth-plugin.

However in my case I've decided to run the generator then to extract what I need from the plugin and delete the plugin itself. The primary reason I am doing this is that I explicitly don't have the login_required method in my auth system, so I would have to monkey patch the lib to get it to work. Secondly, there's a lot of stuff in the plugin I just don't need. Thirdly, most of the stuff that is truly library-level has already been abstracted into the oauth gem proper, so the stuff living in the oauth-plugin lib directory is in this weird no mans land between the generated code and the actual library.

dasil003