CakePHP Authsome - Debuggable's Xmas Gift
Posted on 25/12/09 by Felix Geisendörfer
Merry Xmas everybody. We hope you are having a lovely time and get to renew the batteries for an awesome 2010 over the holidays.
To ease the withdrawal symptoms, Tim and I decided to do some light development over the holidays in order to create a little Xmas gift for the CakePHP community:
The Authsome plugin: Authentication for people who hate the AuthComponent.
We have been using a system very similar to Authsome for all our CakePHP projects over the years, but it wasn't until now that we had a chance to properly decouple it from the individual projects we used it in. A big thanks for that goes to ThreeLeaf Creative, the makers of a fantastic CakePHP CMS system who paid for the refactoring.
Next on the radar is Righteful: Acl for people who hate the Acl component. We hope to have it ready at some point early next year.
Alright, so go ahead and read the authsome docs over at Github and let us know what you think.
Merry Xmas,
-- Tim & Felix
You can skip to the end and add a comment.
Good stuff, thanks for the efforts - also looking forward to Rightful :)
Merry Xmas to you, too!
-- Leo
Thanks for this, I'm not a huge fan of the AuthComponent and look forward to trying Authsome. One question: how well does it play with 1.3-dev?
Thanks a lot! already implemented and fully working :)
I did have a little problem or lack of direction checking for a logged in user. If I don't supply a guest solution, it throws an exception (as it's clearly marked). I replaced the Auth component for this one for the admin area of a site, so basically the "solution" was to manually supply a guest user with id 0, and check for that in the beforeFilter, if the params['admin'] was set. Im sure it's a bit messy. I would love to see an admin area implementation example for this component in the future.
Thanks a lot!
10drill: It should be 100% 1.3-dev compatible, if not let me know and I'll fix it.
Ramiro Araujo: I just made a small update that allows you to return an empty array for the 'guest' type. Now you can check for a guest account as simple as this:
// only do if logged in
}
Let me know if that helps!
(Commit is here: b096bc )
Thanks a lot! Seems to work very much like the stuff i did for projects, but in a way that is actually reusable, elegant and clever.
Confirming Authsome works fine with 1.3-alpha and 1.3-dev, I've (quickly!) added it to four 1.3 projects and not run into any problems. Thanks again!
Awesome stuff, as usual from debuggable.
Any good examples of how to integrate with Facebook Connect, Twitter/Google Oauth, etc? eg. would you pass a type to
?
@Hendler I don't have an example for you, but yes - you would hook this into authsomeLogin in your model.
Great work!! Thanks!!
But..... I can't help but notice that you said in 2008 that you would post every day!!!
Don't worry, I won't hold you to it lol.
Thankyou again for this...
BillyBob: I think that was a 30 day challenge IIRC : ).
Thank you so much for Authsome, I have been recommending it to anyone I can. I think it's as close as you can get to perfect Auth Control in Cake.
I know your busy and it's not that I don't appreciate what you have given us already but please, please, please hurry up Righteful. I'm writing my own component to extend Authsome to support ACL but as hard as I try I highly doubt it will be even close to this quality.
Keep up the good work, and please don't keep us hanging. :)
I have to second rich97's comments.
Thanks again for all your hard work...it does not go unappreciated!
Rob
Thanks for the component ! I'm trying to implement it on a fresh cakephp 1.3 app, but i'm having a bit of a hard time, especially with the cookie part.
I get an 'Undefined Property User::LoginToken' in my User::authSomeLogin function in the user.php model. Is this... normal ?
Cheers,
Thank you! And also thank ThreeLeaf. This just helps everybody, you guys write some elegant code and I would love for this to be picked up by the core. I look forward to Righteful.
Happy holidays and take some time off for the new year!