Ruby on Rails: make LoginEngine fixtures dynamic

June 24th, 2006

admin:
  id: 1
  login: admin
  salted_password: <%= LoginEngine::AuthenticatedUser.salted_password
		(LoginEngine::AuthenticatedUser.hashed("salt-#{Time.now}"), 			LoginEngine::AuthenticatedUser.hashed('atest')) %>
  salt: <%= LoginEngine::AuthenticatedUser.hashed("salt-#{Time.now}") %>
  email: admin@company.com
  verified: 1

This way you always generate fixtures that behave correctly according to your salt and such. Otherwise I had problems when doing “rake load_fixture” in the development db (the login failed).

Programming, Ruby | Comments | Trackback

4 Responses to “Ruby on Rails: make LoginEngine fixtures dynamic”

  1. 1gabrieleNo Gravatar
    June 25th, 2006 @ 05:25

    I missed this: why LoginEngine over AAA ?

  2. 2Enrico FranchiNo Gravatar
    June 25th, 2006 @ 06:59

    I don’t understand what you mean with AAA :)

  3. 3gabrieleNo Gravatar
    June 25th, 2006 @ 13:17

    ouch, sorry, I meant acts_as_authenticated: http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated

  4. 4Enrico FranchiNo Gravatar
    June 25th, 2006 @ 17:05

    Because I use UserEngine on top of LoginEngine. So I get role based authentication. This gives me great degree of flexibility.

    However, I have to admit I’m not completely happy with UserEngine. It “gets a lot in the way” and is probably an overkill. In fact it is probably not the right thing for me. Probably I have to give a try to AAA. :)

    And I need to modify the way UE works: I need to add the concept of “ownership”.

Leave a Reply

  1.  
  2.  
  3.  
  4. XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can keep track of new comments to this post with the comments feed.

Recent Posts

Blogroll

Siti amici

Misc

Recent Comments

Categories

Enrico Franchi graduated in Maths and Computer Science and is now studying for a Computet Science MSc (though because of italian bureaucracy that very course is to be cancelled).

RiK0's Tech Temple is using WP-Gravatar