During development it's often practical to not do real authentication, but rather just get a username back as if you'd actually been authenticated already. This can be easily accomplished in three ways with the filter, by a configuration options:
CAS::Filter.fake = "testuid"
which returns the string provided as a username
CAS::Filter.fake = :param
which takes the value of params[:username] and returns this as the authenticated user, and lastly
CAS::Filter.fake = lambda { |controller| ['testuser1','testuser2','testuser3'][rand(3)] }
which invokes the proc every time the filter is called, and uses the string returned as username.
Anyway, authentication is just one of those things that you don't want to think about. It should just be there. And now it is:
script/plugin install http://svn.ki.se/rails/plugins/cas_auth
Enjoy.
Inga kommentarer:
Skicka en kommentar