ErkanaAuth

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.

6 Responses to “Protecting Controllers with ErkanaAuth”

  1. Marc Stroz Says:

    Short and sweet. Quick and easy lock down.

  2. Joris Heyndrickx Says:

    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");

  3. Michael Wales Says:

    @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.

  4. amos Says:

    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

  5. Michael Wales Says:

    @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.

  6. Austin Biggs Says:

    Does ErkanaAuth still exist? and if so, has it come any further or is it still alpha?

Leave a Reply