phurni / authlogic_api

Authlogic plugin to allow API requests to be authenticated automatically by using an api_key/signature mechanism
MIT License
53 stars 7 forks source link

api_key_param 'app_key' #4

Open tiagopedras opened 13 years ago

tiagopedras commented 13 years ago

Hi

From what I could understand, this plugin intends to use authlogic's authentication process but while using api_key/api_secret instead of login/password (correct me if I'm wrong).

But what is exactly the purpose of this line?

api_key_param 'app_key'

I keep getting a "undefined method `api_key_param'" error if I use it.

Without it the authentication is still not working.

phurni commented 13 years ago

Hi,

Yes, this authentication system will authenticate any request without login/password but by checking an encrypted signature for the request.

The line you are refering, configures the name of the query_string parameter in which the application id is passed for the request. You must put this line in the Session class (see example in README). If you put it anywhere else, you'll get the Exception you mention.

Regards,

Pascal

dave-thompson commented 12 years ago

Hi Guys,

Actually, I think this is a compatibility issue. I got the same error and was able to fix it by moving init.rb from plugins/authlogic_api/rails to plugins/authlogic_api. My guess is that this is a change to the plugin architecture in Rails 3.

Phurni - it might be worth moving this on github? BTW, thanks for the plugin - it's been very useful!

Cheers, Dave

phurni commented 12 years ago

I have to admit that my main project is still on Rails 2.3.x, so I didn't face this problem earlier.

Thanx for the hint.