Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 248 lines (170 sloc) 18.591 kb
43e849c @binarylogic Released v0.10.4
authored
1 = Authlogic
1b98335 @binarylogic Initial commit
authored
2
605162d @binarylogic Release v2.0 RC1
authored
3 Authlogic is a clean, simple, and unobtrusive ruby authentication solution.
1b98335 @binarylogic Initial commit
authored
4
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
5 A code example can replace a thousand words...
6
b365721 @binarylogic Fix typo in mock request
authored
7 Authlogic introduces a new type of model. You can have as many as you want, and name them whatever you want, just like your other models. In this example, we want to authenticate with the User model, which is inferred by the name:
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
8
9 class UserSession < Authlogic::Session::Base
b365721 @binarylogic Fix typo in mock request
authored
10 # specify configuration here, such as:
11 # logout_on_timeout true
12 # ...many more options in the documentation
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
13 end
14
b365721 @binarylogic Fix typo in mock request
authored
15 Log in with any of the following. Create a UserSessionsController and use it just like your other models:
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
16
b365721 @binarylogic Fix typo in mock request
authored
17 UserSession.create(:login => "bjohnson", :password => "my password", :remember_me => true)
18 session = UserSession.new(:login => "bjohnson", :password => "my password", :remember_me => true); session.save
19 UserSession.create(:openid_identifier => "identifier", :remember_me => true) # requires the authlogic-oid "add on" gem
20 UserSession.create(my_user_object, true) # skip authentication and log the user in directly, the true means "remember me"
21
22 The above handles the entire authentication process for you. It first authenticates, then it sets up the proper session values and cookies to persist the session. Just like you would if you rolled your own authentication solution.
23
24 You can also log out / destroy the session:
25
26 session.destroy
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
27
8c8e079 @binarylogic Release v2.0.11
authored
28 After a session has been created, you can persist it across requests. Thus keeping the user logged in:
1b98335 @binarylogic Initial commit
authored
29
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
30 session = UserSession.find
af4f7e0 @binarylogic Documentation fix for using AES as an encryption method.
authored
31
b365721 @binarylogic Fix typo in mock request
authored
32 To get all of the nice authentication functionality in your model just do this:
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
33
b365721 @binarylogic Fix typo in mock request
authored
34 class User < ActiveRecord::Base
35 acts_as_authentic do |c|
36 c.my_config_option = my_value
37 end # the configuration block is optional
38 end
9bca67d @binarylogic Reorganized ORM code and tests
authored
39
b365721 @binarylogic Fix typo in mock request
authored
40 This handles validations, etc. It is also "smart" in the sense that it if a login field is present it will use that to authenticate, if not it will look for an email field, etc. This is all configurable, but for 99% of cases that above is all you will need to do.
41
42 Also, sessions are automatically maintained. You can switch this on and off with configuration, but the following will automatically log a user in after a successful registration:
c5e610a @binarylogic * Extracted Authlogics regular expressions into its own module to allow ...
authored
43
44 User.create(params[:user])
45
46 This also updates the session when the user changes his/her password.
47
b365721 @binarylogic Fix typo in mock request
authored
48 Authlogic is very flexible, it has a strong public API and a plethora of hooks to allow you to modify behavior and extend it. Check out the helpful links below to dig deeper.
49
605162d @binarylogic Release v2.0 RC1
authored
50 == Helpful links
51
e44e1e3 @binarylogic Add gemspec for github
authored
52 * <b>Documentation:</b> http://rdoc.info/projects/binarylogic/authlogic
f638b12 @binarylogic * Added the ability to add a last_request_update_allowed? method in your...
authored
53 * <b>Repository:</b> http://github.com/binarylogic/authlogic/tree/master
261e8ad @binarylogic Cleanup how generalize_credentials_error_messages is implemented
authored
54 * <b>Railscasts Screencast:</b> http://railscasts.com/episodes/160-authlogic
f638b12 @binarylogic * Added the ability to add a last_request_update_allowed? method in your...
authored
55 * <b>Live example with OpenID "add on":</b> http://authlogicexample.binarylogic.com
56 * <b>Live example repository with tutorial in README:</b> http://github.com/binarylogic/authlogic_example/tree/master
57 * <b>Tutorial: Reset passwords with Authlogic the RESTful way:</b> http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic
4eaf68e @binarylogic Update issue link, moved from lighthouse to github
authored
58 * <b>Issues:</b> http://github.com/binarylogic/authlogic/issues
605162d @binarylogic Release v2.0 RC1
authored
59 * <b>Google group:</b> http://groups.google.com/group/authlogic
60
d23f64e @binarylogic Add some comments on testing Authlogic, with a link to Authlogic::TestCa...
authored
61 <b>Before contacting me directly, please read:</b>
51f7b28 @binarylogic * Reset the @password_changed instance variable after the record has bee...
authored
62
4eaf68e @binarylogic Update issue link, moved from lighthouse to github
authored
63 If you find a bug or a problem please post it in the issues section. If you need help with something, please use google groups. I check both regularly and get emails when anything happens, so that is the best place to get help. This also benefits other people in the future with the same questions / problems. Thank you.
ee1f49b @binarylogic * Use MockCookieJar in tests instead of a Hash.
authored
64
5c0ac4f @binarylogic * Make password and login fields optional. This allows you to have an al...
authored
65 == Authlogic "add ons"
ee1f49b @binarylogic * Use MockCookieJar in tests instead of a Hash.
authored
66
f638b12 @binarylogic * Added the ability to add a last_request_update_allowed? method in your...
authored
67 * <b>Authlogic OpenID addon:</b> http://github.com/binarylogic/authlogic_openid
68 * <b>Authlogic LDAP addon:</b> http://github.com/binarylogic/authlogic_ldap
bcb0d4a @binarylogic * Stop using errors.on(key) since that is now deprecated in Rails. Use e...
authored
69 * <b>Authlogic Facebook Connect:</b> http://github.com/kalasjocke/authlogic_facebook_connect
5f58f39 @trobrock Adding a link to a fork of the authlogic for facebook that supports the ...
trobrock authored
70 * <b>Authlogic Facebook Connect (New JS API):</b> http://github.com/studybyte/authlogic_facebook_connect
639a035 @jrallison Signed-off-by: Ben Johnson <bjohnson@binarylogic.com>
jrallison authored
71 * <b>Authlogic OAuth (Twitter):</b> http://github.com/jrallison/authlogic_oauth
36ad855 @nbudin Added nbudin's authlogic_pam addon to the list
nbudin authored
72 * <b>Authlogic PAM:</b> http://github.com/nbudin/authlogic_pam
ee1f49b @binarylogic * Use MockCookieJar in tests instead of a Hash.
authored
73
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
74 If you create one of your own, please let me know about it so I can add it to this list. Or just fork the project, add your link, and send me a pull request.
605162d @binarylogic Release v2.0 RC1
authored
75
f638b12 @binarylogic * Added the ability to add a last_request_update_allowed? method in your...
authored
76 == Session bugs (please read if you are having issues with logging in / out)
77
78 Apparently there is a bug with apache / passenger for v2.1.X with sessions not working properly. This is most likely your problem if you are having trouble logging in / out. This is *not* an Authlogic issue. This can be solved by updating passener or using an alternative session store solution, such as active record store.
79
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
80 == Documentation explanation
605162d @binarylogic Release v2.0 RC1
authored
81
60e5445 @jjb Correct URL to documentation.
jjb authored
82 You can find anything you want about Authlogic in the {documentation}[http://rdoc.info/projects/binarylogic/authlogic], all that you need to do is understand the basic design behind it.
605162d @binarylogic Release v2.0 RC1
authored
83
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
84 That being said, there are 2 models involved during authentication. Your Authlogic model and your ActiveRecord model:
605162d @binarylogic Release v2.0 RC1
authored
85
d23f64e @binarylogic Add some comments on testing Authlogic, with a link to Authlogic::TestCa...
authored
86 1. <b>Authlogic::Session</b>, your session models that extend Authlogic::Session::Base.
87 2. <b>Authlogic::ActsAsAuthentic</b>, which adds in functionality to your ActiveRecord model when you call acts_as_authentic.
605162d @binarylogic Release v2.0 RC1
authored
88
0823cc7 @binarylogic Releast v2.0.10
authored
89 Each of the above has its various sub modules that contain common logic. The sub modules are responsible for including *everything* related to it: configuration, class methods, instance methods, etc.
605162d @binarylogic Release v2.0 RC1
authored
90
60e5445 @jjb Correct URL to documentation.
jjb authored
91 For example, if you want to timeout users after a certain period of inactivity, you would look in <b>Authlogic::Session::Timeout</b>. To help you out, I listed the following publicly relevant modules with short descriptions. For the sake of brevity, there are more modules than listed here, the ones not listed are more for internal use, but you can easily read up on them in the {documentation}[http://rdoc.info/projects/binarylogic/authlogic].
605162d @binarylogic Release v2.0 RC1
authored
92
c355cdd @binarylogic Some documentation clean up
authored
93 === Authlogic::ActsAsAuthentic sub modules
605162d @binarylogic Release v2.0 RC1
authored
94
d23f64e @binarylogic Add some comments on testing Authlogic, with a link to Authlogic::TestCa...
authored
95 These modules are for the ActiveRecord side of things, the models that call acts_as_authentic.
605162d @binarylogic Release v2.0 RC1
authored
96
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
97 * <b>Authlogic::ActsAsAuthentic::Base</b> - Provides the acts_as_authentic class method and includes all of the submodules.
98 * <b>Authlogic::ActsAsAuthentic::Email</b> - Handles everything related to the email field.
99 * <b>Authlogic::ActsAsAuthentic::LoggedInStatus</b> - Provides handy named scopes and methods for determining if the user is logged in or out.
100 * <b>Authlogic::ActsAsAuthentic::Login</b> - Handles everything related to the login field.
b365721 @binarylogic Fix typo in mock request
authored
101 * <b>Authlogic::ActsAsAuthentic::MagicColumns</b> - Handles everything related to the "magic" fields: login_count, failed_login_count, last_request_at, etc.
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
102 * <b>Authlogic::ActsAsAuthentic::Password</b> - This one is important. It handles encrypting your password, salting it, etc. It also has support for transitioning password algorithms.
103 * <b>Authlogic::ActsAsAuthentic::PerishableToken</b> - Handles maintaining the perishable token field, also provides a class level method for finding record using the token.
104 * <b>Authlogic::ActsAsAuthentic::PersistenceToken</b> - Handles maintaining the persistence token. This is the token stored in cookies and sessions to persist the users session.
105 * <b>Authlogic::ActsAsAuthentic::RestfulAuthentication</b> - Provides configuration options to easily migrate from the restful_authentication plugin.
b365721 @binarylogic Fix typo in mock request
authored
106 * <b>Authlogic::ActsAsAuthentic::SessionMaintenance</b> - Handles automatic session maintenance. EX: a new user registers, automatically log them in. Or a user changes their password, update their session.
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
107 * <b>Authlogic::ActsAsAuthentic::SingleAccessToken</b> - Handles maintaining the single access token.
b365721 @binarylogic Fix typo in mock request
authored
108 * <b>Authlogic::ActsAsAuthentic::ValidationsScope</b> - Allows you to scope all validations, etc. Just like the :scope option for validates_uniqueness_of
605162d @binarylogic Release v2.0 RC1
authored
109
c355cdd @binarylogic Some documentation clean up
authored
110 === Authlogic::Session sub modules
605162d @binarylogic Release v2.0 RC1
authored
111
d23f64e @binarylogic Add some comments on testing Authlogic, with a link to Authlogic::TestCa...
authored
112 These modules are for the models that extend Authlogic::Session::Base.
605162d @binarylogic Release v2.0 RC1
authored
113
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
114 * <b>Authlogic::Session::BruteForceProtection</b> - Disables accounts after a certain number of consecutive failed logins attempted.
b365721 @binarylogic Fix typo in mock request
authored
115 * <b>Authlogic::Session::Callbacks</b> - Your tools to extend, change, or add onto Authlogic. Lets you hook in and do just about anything you want. Start here if you want to write a plugin or add-on for Authlogic
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
116 * <b>Authlogic::Session::Cookies</b> - Authentication via cookies.
117 * <b>Authlogic::Session::Existence</b> - Creating, saving, and destroying objects.
118 * <b>Authlogic::Session::HttpAuth</b> - Authentication via basic HTTP authentication.
119 * <b>Authlogic::Session::Id</b> - Allows sessions to be separated by an id, letting you have multiple sessions for a single user.
120 * <b>Authlogic::Session::MagicColumns</b> - Maintains "magic" database columns, similar to created_at and updated_at for ActiveRecord.
121 * <b>Authlogic::Session::MagicStates</b> - Automatically validates based on the records states: active?, approved?, and confirmed?. If those methods exist for the record.
122 * <b>Authlogic::Session::Params</b> - Authentication via params, aka single access token.
123 * <b>Authlogic::Session::Password</b> - Authentication via a traditional username and password.
124 * <b>Authlogic::Session::Persistence</b> - Persisting sessions / finding sessions.
125 * <b>Authlogic::Session::Session</b> - Authentication via the session, the controller session that is.
126 * <b>Authlogic::Session::Timeout</b> - Automatically logging out after a certain period of inactivity.
b365721 @binarylogic Fix typo in mock request
authored
127 * <b>Authlogic::Session::UnauthorizedRecord</b> - Handles authentication by passing an ActiveRecord object directly.
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
128 * <b>Authlogic::Session::Validation</b> - Validation / errors.
2155477 @binarylogic Updated readme
authored
129
605162d @binarylogic Release v2.0 RC1
authored
130 === Miscellaneous modules
43e849c @binarylogic Released v0.10.4
authored
131
d23f64e @binarylogic Add some comments on testing Authlogic, with a link to Authlogic::TestCa...
authored
132 Miscellaneous modules that shared across the authentication process and are more "utility" modules and classes.
78f5bef @binarylogic Restructure configuration for acts_as_authentic
authored
133
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
134 * <b>Authlogic::AuthenticatesMany</b> - Responsible for allowing you to scope sessions to a parent record. Similar to a has_many and belongs_to relationship. This lets you do the same thing with sessions.
135 * <b>Authlogic::CryptoProviders</b> - Contains various encryption algorithms that Authlogic uses, allowing you to choose your encryption method.
136 * <b>Authlogic::I18n</b> - Acts JUST LIKE the rails I18n library, and provides internationalization to Authlogic.
137 * <b>Authlogic::Random</b> - A simple class to generate random tokens.
b365721 @binarylogic Fix typo in mock request
authored
138 * <b>Authlogic::Regex</b> - Contains regular expressions used in Authlogic. Such as those to validate the format of the log or email.
d1bf2d1 @binarylogic Fix some RDOC syntax mistakes
authored
139 * <b>Authlogic::TestCase</b> - Various helper methods for testing frameworks to help you test your code.
140 * <b>Authlogic::Version</b> - A handy class for determine the version of Authlogic in a number of ways.
605162d @binarylogic Release v2.0 RC1
authored
141
0823cc7 @binarylogic Releast v2.0.10
authored
142 == Quick Rails example
605162d @binarylogic Release v2.0 RC1
authored
143
144 What if creating sessions worked like an ORM library on the surface...
e77ca8a @binarylogic Updated readme
authored
145
4b1f8fa @binarylogic User column_names instead of colums when determining if a column exists
authored
146 UserSession.create(params[:user_session])
e77ca8a @binarylogic Updated readme
authored
147
34b225c @binarylogic Updated readme
authored
148 What if your user sessions controller could look just like your other controllers...
1b98335 @binarylogic Initial commit
authored
149
150 class UserSessionsController < ApplicationController
151 def new
152 @user_session = UserSession.new
153 end
154
155 def create
156 @user_session = UserSession.new(params[:user_session])
35f14ba @binarylogic Released v0.10.0
authored
157 if @user_session.save
c93bec2 @binarylogic Changed scope to id
authored
158 redirect_to account_url
1b98335 @binarylogic Initial commit
authored
159 else
160 render :action => :new
161 end
162 end
163
164 def destroy
ebdebfa @binarylogic Released v1.1.1
authored
165 current_user_session.destroy
4caccd0 @binarylogic Released 1.2.1
authored
166 redirect_to new_user_session_url
1b98335 @binarylogic Initial commit
authored
167 end
168 end
169
605162d @binarylogic Release v2.0 RC1
authored
170 As you can see, this fits nicely into the RESTful development pattern. What about the view...
1b98335 @binarylogic Initial commit
authored
171
172 <% form_for @user_session do |f| %>
791f700 @binarylogic Released v1.0.0 (see changelog)
authored
173 <%= f.error_messages %>
1b98335 @binarylogic Initial commit
authored
174 <%= f.label :login %><br />
175 <%= f.text_field :login %><br />
176 <br />
177 <%= f.label :password %><br />
178 <%= f.password_field :password %><br />
179 <br />
180 <%= f.submit "Login" %>
181 <% end %>
182
34b225c @binarylogic Updated readme
authored
183 Or how about persisting the session...
1b98335 @binarylogic Initial commit
authored
184
185 class ApplicationController
ebdebfa @binarylogic Released v1.1.1
authored
186 helper_method :current_user_session, :current_user
1b98335 @binarylogic Initial commit
authored
187
dbd8b8f @binarylogic Release v1.2.0
authored
188 private
ebdebfa @binarylogic Released v1.1.1
authored
189 def current_user_session
190 return @current_user_session if defined?(@current_user_session)
191 @current_user_session = UserSession.find
192 end
193
69f2c2b @binarylogic Add a logout_on_timeout configuration option for Session::Base
authored
194 def current_user
ebdebfa @binarylogic Released v1.1.1
authored
195 return @current_user if defined?(@current_user)
196 @current_user = current_user_session && current_user_session.user
1b98335 @binarylogic Initial commit
authored
197 end
198 end
199
0f38680 @binarylogic Update README and move setup tutorial to authlogic_example
authored
200 == Install & Use
c355cdd @binarylogic Some documentation clean up
authored
201
93a4787 @binarylogic Added Sha1 crypto provider to help with the restful_authentication trans...
authored
202 Install the gem / plugin (recommended)
1b98335 @binarylogic Initial commit
authored
203
58d726d @binarylogic Update the readme
authored
204 From rubyforge:
205
43e849c @binarylogic Released v0.10.4
authored
206 $ sudo gem install authlogic
1b98335 @binarylogic Initial commit
authored
207
5383419 @binarylogic Use mb_chars when downcasing login to deal with international characters
authored
208 Or from github:
58d726d @binarylogic Update the readme
authored
209
210 $ sudo gem install binarylogic-authlogic
211
e44e1e3 @binarylogic Add gemspec for github
authored
212 Now just add the gem dependency in your projects configuration.
93a4787 @binarylogic Added Sha1 crypto provider to help with the restful_authentication trans...
authored
213
5383419 @binarylogic Use mb_chars when downcasing login to deal with international characters
authored
214 Or you can install this as a plugin:
1b98335 @binarylogic Initial commit
authored
215
43e849c @binarylogic Released v0.10.4
authored
216 script/plugin install git://github.com/binarylogic/authlogic.git
1b98335 @binarylogic Initial commit
authored
217
0823cc7 @binarylogic Releast v2.0.10
authored
218 == Detailed Setup Tutorial
35f14ba @binarylogic Released v0.10.0
authored
219
0823cc7 @binarylogic Releast v2.0.10
authored
220 See the {authlogic example}[http://github.com/binarylogic/authlogic_example/tree/master] for a detailed setup tutorial. I did this because not only do you have a tutorial to go by, but you have an example app that uses the same tutorial, so you can play around with with the code. If you have problems you can compare the code to see what you are doing differently.
40267c6 @binarylogic Update README with more thoroughh tutorial, the tutorial on my blog will...
authored
221
d23f64e @binarylogic Add some comments on testing Authlogic, with a link to Authlogic::TestCa...
authored
222 == Testing
223
224 I think one of the best aspects of Authlogic is testing. For one, it cuts out <b>a lot</b> of redundant tests in your applications because Authlogic is already thoroughly tested for you. It doesn't include a bunch of tests into your application, because it comes tested, just like any other library.
225
226 For example, think about ActiveRecord. You don't test the internals of ActiveRecord, because the creators of ActiveRecord have already tested the internals for you. It wouldn't make sense for ActiveRecord to copy it's hundreds of tests into your applications. The same concept applies to Authlogic. You only need to test code you write that is specific to your application, just like everything else in your application.
227
faa063f @binarylogic Fix compatibility issue with rails >3.0 wanting the model_name class met...
authored
228 That being said, testing your code that uses Authlogic is easy. Since everyone uses different testing suites, I created a helpful module called Authlogic::TestCase, which is basically a set of tools for testing code using Authlogic. I explain testing Authlogic thoroughly in the {Authlogic::TestCase section of the documentation}[http://rdoc.info/rdoc/binarylogic/authlogic/blob/f2f6988d3b97e11770b00b72a7a9733df69ffa5b/Authlogic/TestCase.html]. It should answer any questions you have in regards to testing Authlogic.
d23f64e @binarylogic Add some comments on testing Authlogic, with a link to Authlogic::TestCa...
authored
229
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
230 == Tell me quickly how Authlogic works
2155477 @binarylogic Updated readme
authored
231
b365721 @binarylogic Fix typo in mock request
authored
232 Interested in how all of this all works? Think about an ActiveRecord model. A database connection must be established before you can use it. In the case of Authlogic, a controller connection must be established before you can use it. It uses that controller connection to modify cookies, the current session, login with HTTP basic, etc. It connects to the controller through a before filter that is automatically set in your controller which lets Authlogic know about the current controller object. Then Authlogic leverages that to do everything, it's a pretty simple design. Nothing crazy going on, Authlogic is just leveraging the tools your framework provides in the controller object.
2155477 @binarylogic Updated readme
authored
233
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
234 == What sets Authlogic apart and why I created it
2155477 @binarylogic Updated readme
authored
235
8c8e079 @binarylogic Release v2.0.11
authored
236 What inspired me to create Authlogic was the messiness of the current authentication solutions. Put simply, they just didn't feel right, because the logic was not organized properly. As you may know, a common misconception with the MVC design pattern is that the model "M" is only for data access logic, which is wrong. A model is a place for domain logic. This is why the RESTful design pattern and the current authentication solutions don't play nice. Authlogic solves this by placing the session maintenance logic into its own domain (aka "model"). Moving session maintenance into its own domain has its benefits:
ec0eb78 @binarylogic Updated readme
authored
237
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
238 1. <b>It's cleaner.</b> There are no generators in Authlogic. Authlogic provides a class that you can use, it's plain and simple ruby. More importantly, the code in your app is code you write, written the way you want, nice and clean. It's code that should be in your app and is specific to your app, not a redundant authentication pattern.
2af08ab @binarylogic Add a quick model explanation in the README
authored
239 2. <b>Easier to stay up-to-date.</b> To make my point, take a look at the commits to any other authentication solution, then look at the {commits for authlogic}[http://github.com/binarylogic/authlogic/commits/master]. How many commits could you easily start using if you already had an app using that solution? With an alternate solution, very few, if any. All of those cool new features and bug fixes are going to have be manually added or wait for your next application. Which is the main reason a generator is not suitable as an authentication solution. With Authlogic you can start using the latest code with a simple update of a gem. No generators, no mess.
061fac1 @binarylogic Bump to v2.1.2
authored
240 3. <b>It ties everything together on the domain level.</b> Take a new user registration for example, no reason to manually log the user in, authlogic handles this for you via callbacks. The same applies to a user changing their password. Authlogic handles maintaining the session for you.
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
241 4. <b>No redundant tests.</b> Because Authlogic doesn't use generators, #1 also applies to tests. Authlogic is *thoroughly* tested for you. You don't go and test the internals of ActiveRecord in each of your apps do you? So why do the same for Authlogic? Your application tests should be for application specific code. Get rid of the noise and make your tests focused and concise, no reason to copy tests from app to app.
4732d05 @binarylogic Add note about rails cookie store bug for sessions.
authored
242 5. <b>Framework agnostic</b>. Authlogic can be used in *any* ruby framework you want: Rails, Merb, Sinatra, Mack, your own framework, whatever. It's not tied down to Rails. It does this by abstracting itself from these framework's controllers by using a controller adapter. Thanks to {Rack}[http://rack.rubyforge.org/], there is a defined standard for controller structure, and that's what Authlogic's abstract adapter follows. So if your controller follows the rack standards, you don't need to do anything. Any place it deviates from this is solved by a simple adapter for your framework that closes these gaps. For an example, checkout the Authlogic::ControllerAdapters::MerbAdapter.
ec82400 @binarylogic Make the README simpler and more to-the-point
authored
243 5. <b>You are not restricted to a single session.</b> Think about Apple's me.com, where they need you to authenticate a second time before changing your billing information. Why not just create a second session for this? It works just like your initial session. Then your billing controller can require an "ultra secure" session.
72992b9 @reinh Fix misplaced apostrophe in README
reinh authored
244 6. <b>Easily extendable.</b> One of the distinct advantages of using a library is the ability to use its API, assuming it has one. Authlogic has an *excellent* public API, meaning it can easily be extended and grow beyond the core library. Checkout the "add ons" list above to see what I mean.
ec0eb78 @binarylogic Updated readme
authored
245
1b98335 @binarylogic Initial commit
authored
246
36ad855 @nbudin Added nbudin's authlogic_pam addon to the list
nbudin authored
247 Copyright (c) 2009 {Ben Johnson of Binary Logic}[http://www.binarylogic.com], released under the MIT license
Something went wrong with that request. Please try again.