auth via params API Access with Authlogic

Authlogic, my current favorite Ruby-based authentication library and I were in a fight the last couple of days.

I was trying to add token-based, auth_via_params, authentication (vs. login and password) to a project – but Authlogic and I weren’t agreeing on how it should be done.

I had assumed:

@person_session = PersonSession.new(single_access_token => params[:token] )
@person_session.save

Instead Authlogic wanted me to give it a Person first.

@person_session = PersonSession.new(Person.find_by_single_access_token(params[:token]))
@person_session.save

1 thought on “auth via params API Access with Authlogic

  1. Bruno Frank

    Hi, did you solve this problem with Authlogic and single access token? When i was investigating i find a method persist_by_params but this method is private.

    Thank you!

Comments are closed.