Welcome Guest, Not a member yet? Register   Sign In
Starting in on a new Authentication package
#1

I've been working on Community Auth for years, and I love CodeIgniter so I use it all the time. Other people's comments and issues have really helped refine it, and I will of course use it for as long as necessary. A couple days ago I started in on a new authentication package, and it's really geared towards use on any framework, and possibly use without a framework. It could certainly be useful for CI4 users.

As it's really pretty early in the development process, I got to the point where I've more or less roughed out the basics, and thought it would be good to get some other people's eyes on it.
  • There's a Core class that will handle login attempts, checking if logged in, checking for holds, logouts.
  • A Model, Input, Session, and Password class are injected into Core, and these classes must be instances of their respective Interface. In a real implementation of this class, it's expected that somebody would set this all up in a dependency injection container.
  • I've got 0 dependencies, which is how I'd like to keep it. I guess technically an autoloader is a dependency, so if you're counting that I've got 1.
  • I've tried to come up with a strategy that would allow somebody to easily use any database.
  • I've kept the focus on authentication, and assumed people will want to use their own Model, Input, Session, and Password classes. You'll see notes at the top of some of these classes indicating that is the intention, and why they are so minimalistic.
  • I've never been much of a unit tester, but did some of that, and made an "HTTP test" which is run by going to /tests/http/index.php. The testing could surely benefit from somebody who is more familiar with unit testing when sessions and database are involved.
Please take a look and leave me some comments here. If you like the direction and would like to help out, there's definitely room for more than one cook in this kitchen. There's also time for big changes, although I'm not seeing why there would need to be.

https://bitbucket.org/skunkbad/php-unive...cation/src
Reply
#2

I cannot really add anything to this that would be of any value, but I just wanted to say that your code is beautifully written. A real pleasure to read through. So plain and so clear and so well laid out.

I know it has been said many times before, and argued with, but I really do think a CI auth model (that was optional to implement) would be a real benefit to new/junior developers. I swing about on this in truth, a few months ago I thought it was not needed for a framework like CI, but right now I do think it would be a benefit.

Anyhow, good luck with your new project. I hope it goes well.

Paul.
Reply
#3

Paul, thanks for the complement.

The thing about Auth is that you really can't please a significant percentage of devs no matter what you do. I'm a little biased, but I really don't like the other Auth libraries/packages that are available for CI. Many people probably don't like mine, ya know? A super well thought out package that offers support for as many database types that CI supports, along with enough features to make it good, and one that is easy to use for the average CI user (who is pretty low skill level) is a major project. Besides that, Auth relies on Sessions, and you've seen how many people ask about that already.

Speaking of sessions, I've been playing around with Symfony's PDO Session Handler tonight. Got it working with my new Auth and it was tight (like a tiger) Smile Ah, the things you do when you get old. Other people are out partying on a Saturday night, and I'm clackin' on the keyboard...
Reply
#4

Wish list Smile
1. one simultaneous session at a time.

Great work, keep up.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB