Protecting Controllers with ErkanaAuth
February 26th, 2010

ErkanaAuth, although in a very alpha form, is simple to use and already extremely powerful. Protecting a portion of your website behind the authentication system is as easy as one-line, a call to the library’s required() method.
In this example, we are protecting an entire controller behind the authentication library:
When a method within this controller is called, the user’s session will be validated. If the user has not authenticated they will then be forwarded to your application’s accounts controller, where your login and user creation methods should reside.
To protect individual methods, just call the required() method in the first line of the method you want to protect.

February 27th, 2010 at 12:14 am
Short and sweet. Quick and easy lock down.
February 27th, 2010 at 7:55 pm
What about protecting controllers from certain users in a role based system? For instance protecting a controller, allowing only access to it if the user is logged in AND has a enough privileges.
// allow only admin users$this->erkana_auth->required("admin");
February 27th, 2010 at 7:58 pm
@Joris:
ErkanaAuth does not currently have a role system but it is definitely in the plans. Check out the original post for a list of planned features.
May 11th, 2010 at 4:41 pm
Hey,
Thanks for releasing this great app. You didn’t supply a download link in this post and just linked to the earlier post which says clearly the app is not yet ready for production… Is it still the case?
Also, I assume that the app which I found on the CI wiki is the old, 2007 version of ErkanaAuth?
Thanks,
Amos
May 11th, 2010 at 4:50 pm
@amos
This library is not ready for production only in the sense that I have not fully tested it within a production environment – I’ve yet to hear any bad reports though. Yes, the version on the wiki is an older version, this version has gone in a completely different direction.
April 12th, 2011 at 10:33 am
Does ErkanaAuth still exist? and if so, has it come any further or is it still alpha?