ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Ion Auth - Lightweight Auth System based on Redux Auth 2

February 10, 2010 7:00pm

Subscribe [287]
  • #856 / Mar 23, 2011 4:54pm

    Kevin Smith

    4784 posts

    I’m writing a method to allow a user to update his/her email address, but I’d like to require them to enter their current password and have the application validate against that before updating the email address. Anyone have a best practice for how to do this?

  • #857 / Mar 23, 2011 10:52pm

    dhaulagiri

    37 posts

    I cannot see register function in auth controller but there is in ion_auth library, how do i implement it ?

    Hi dhaulagiri

    Look at function create_user() in the sample controller (auth.php), there is an example there.

    if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data, $group))


    Russ

    Do i need to create new function for user to register ?

  • #858 / Mar 24, 2011 5:39am

    rulin

    18 posts

    I cannot see register function in auth controller but there is in ion_auth library, how do i implement it ?

    Hi dhaulagiri

    Look at function create_user() in the sample controller (auth.php), there is an example there.

    if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data, $group))


    Russ

    Do i need to create new function for user to register ?

    If you mean you want a screen where users can register themselves, then yes.
    I don’t think there is anything in Ben’s demo code specifically for that.
    You can probably create something fairly easily based on the Create_user view.

    Russ

  • #859 / Mar 24, 2011 12:36pm

    dhaulagiri

    37 posts

    i can see lots of people talking abt registration, hi ben can could u pls tell me, if i have to create register function in auth controller or it’s already there somewhere ?

  • #860 / Mar 24, 2011 1:46pm

    rulin

    18 posts

    i can see lots of people talking abt registration, hi ben can could u pls tell me, if i have to create register function in auth controller or it’s already there somewhere ?


    If you go into /index.php/auth and log on with ‘[email protected]’ and ‘password’ it takes you into a user maintenance screen where you can register new users.
    Is this what you mean?

    Russ

  • #861 / Mar 24, 2011 3:41pm

    dhaulagiri

    37 posts

    i can see lots of people talking abt registration, hi ben can could u pls tell me, if i have to create register function in auth controller or it’s already there somewhere ?


    If you go into /index.php/auth and log on with ‘[email protected]’ and ‘password’ it takes you into a user maintenance screen where you can register new users.
    Is this what you mean?

    Russ

    no , i mean make a registration form for new users. Is there a possiblity of facebook/twitter integration for new user egistration ?

  • #862 / Mar 25, 2011 10:06am

    Ben Edmunds

    812 posts

    dhaulagiri,

    No not built in.  You can create one is conjunction with the register() method but there is nothing in Ion Auth to do all the work for you.

  • #863 / Mar 27, 2011 11:27pm

    fanxuan

    2 posts

    Hey everybody,

    Just wanted to “officially” announce the release of Ion_Auth.  It’s based on Redux Auth 2 but with a whole lot more awesomeness added in.

    You can get it here:
    http://github.com/benedmunds/CodeIgniter-Ion-Auth


    Redux Auth 2 had a lot of potential.  It’s lightweight, simple, and clean,
    but had a ton of bugs and was missing some key features.

    So I’ve refactored the code and added new methods and functions with the much
    appreciated help of Phil Sturgeon.

    INSTALLATION:
    Just copy the files from this package to the corresponding folder in your
    application folder.  For example, copy Ion_auth/config/ion_auth.php to
    system/application/config/ion_auth.php.

    USING THE LIBRARY: 
    In the package you will find example usage code in the controllers and views
    folders.  The example code isn’t the most beautiful code you’ll ever see but
    it’ll show you how to use the library and it’s nice and generic so it doesn’t
    require a MY_controller or anything but it will be easy to add render() methods
    if needed since there is only one load->view() per controller method. 


    IMPORTANT: 
    It is highly recommended that you use encrypted database sessions for security!

    Feel free to send me an email if you have any problems.


    Thanks,

    Thanks ben for sharing an excellent auth like this. But it is support ci 2.0 ?
    Will I need to change some codes for the new ci 2.0?

  • #864 / Mar 27, 2011 11:28pm

    Ben Edmunds

    812 posts

    fanxuan,

    CI2 is supported.

  • #865 / Apr 01, 2011 11:55am

    jant90

    7 posts

    I want to make sign up as easy as possible and therefore I just ask for the users e-mail address and a password.

    This means I won’t generate an username (as per example), should I simply register the user like this?:

    $this->ion_auth->register('', $password, $email, '')

    I just started using Ion Auth so I’m wondering whether this practice might be bad or might give problems in the future (as username will be NULL).

    Also I’m wondering what the user_expire option does, is that for how long the remember me button works? Because in that case the default value of about 24 hours seems a bit short.

  • #866 / Apr 01, 2011 2:30pm

    jant90

    7 posts

    I have another question, if a user is logged in on 2 locations (or 2 different browsers for that matter) and thus has 2 active sessions and changes his/her password in one of the sessions, how can you then log the user out from both sessions? It is easy to log the user out in the sessions where the password is changed, but then the other still remains logged in.

    Take a scenario where a user’s account is ‘hacked’ and the hacker logs in on the account, then the user can quickly change the password but still won’t lock the hacker out. Is there a way to enforce this? To destroy all active sessions as soon as the password is changed?

  • #867 / Apr 01, 2011 6:48pm

    Ben Edmunds

    812 posts

    jant90,

    Username -
    I usually just pass the email as the username as well when using email as the identity.

    User_expire -
    Yes it is for remember me.  Increase it if you need longer.

    Session -
    If you use DB sessions you should be able to do this.

  • #868 / Apr 02, 2011 1:19pm

    - Obonk -

    10 posts

    I got some problems with CI sess_time_to_update and ionauth, if CI reach the sess_time_to_update it will generate new random session id, my problems is user always redirecting to login page as if the user is not login event the user alrady login before.

    can some one help me with this? or I just miss to configured the ionauth?

    Thanks for the help

  • #869 / Apr 03, 2011 9:05pm

    jant90

    7 posts

    Thanks Ben, for the reply and your work on Ion Auth in general!

    However I’m storing sessions in the database and I don’t think that works, I believe there will simply be 2 different sessions in the database.

  • #870 / Apr 04, 2011 10:30am

    Ben Edmunds

    812 posts

    jant90,

    I seem to remember someone saying they accomplished this using DB sessions.  I know it’s a huge thread by I would recommend going through this thread and seeing if you can find it.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases