Although CodeIgniter 2.1 was released few days ago (latest version is CodeIgniter 3), it still does not has a native authentication library (or maybe never). Are you searching for an authentication library for CodeIgniter? Here, I would like to suggest several libraries which can make your life easier. Why do you want to create a new library or code the authentication system by yourself if there is a superb one? On top of that, it is free!
Below are 5 best authentication libraries for CodeIgniter (from my observation). You can give them a try! Most of them are compatible with CodeIgniter 2.1 (I guess, hehehe 😀 ). However, please keep in mind that each library maybe offers different features. Hence, the security features can be varies.
1. AG Auth
Some killer features of AG Auth:
- Secure remember me
- Strong username and password policy server side
- Maximum number of failed login attempts, security against DDoS or Bruteforce attacks
2. Bit Auth
Bit Auth is written by Dan Montgomery. It is a group-based authentication and permissions system that uses bitwise operation to allow you, as a developer, to easily control access within your application.
Features which are in place: password aging, complexity rules, and completely customizable user fields. See Bit Auth main page for full documentations.
3. DX Auth
It’s based on CL Auth 0.2.5 beta developed by Jason Ashdown. The goal is to enable you to easily include secure and easy to use authentication library to your project, while giving you the flexibility to choose from simple authentication system to full fledged authentication system.
Some cool features of DX Auth:
- Ban user
- Last login IP address and time
- Role based (admin, user, moderator, etc). Inheritance also supported
- Custom permission for each role
- Login attempt (optional). You can use this to display catpcha after specified try to login to prevent bot.
- Simple admin panel
Visit DX Auth documentation page for more.
Update 16 July 2017: This library is currently maintained by Yoosuf.
4. Ion Auth
Ion Auth is currently maintained by Ben Edmunds. It is a simple and lightweight authentication library for the CodeIgniter framework. This is my preference because it is easy to use for newbie.
5. Tank Auth
Tank Auth is an authentication library for PHP-framework CodeIgniter. It’s based on DX Auth, although the code was seriously reworked.
There are several other authentication libraries. You can check them out at CodeIgniter Wikipage. You may want to integrate one of this library with the blog that you have created using CodeIgniter. I’ll try to publish a tutorial on this topic as soon as possible.
P/s: This review was written and published in November 2011.