Blog: Authentication

  • CodeIgniter 2 + Sparks + PHP ActiveRecord Part 3: Login

    Aug 17, 2011

    In this episode we'll use the user model that we created to enable our users to login to our site. We'll refactor the user model a bit, extend the CI_Controller class, and create the forms necessary to have a completely working login system.

    Be sure to watch in HD.

    Download the source for part 3.

  • CodeIgniter 2 + Sparks + PHP ActiveRecord Part 2: The User Model

    Aug 3, 2011

    In this episode we create a user model and focus on securely storing passwords in a database table by using sha256 encryption. We go over the reasons why using MD5 is no longer acceptable and we create a password validation method.

    Be sure to watch in HD.

    Download the source for part 2.

  • Developing a Website with CodeIgniter Part 3: The Login Process

    Nov 9, 2009

    This screencast continues a series with the goal of documenting the development of a functionally complete site using PHP with the Code Igniter framework and jQuery for Javascript UI improvements including AJAX interactions.

    In this video we utilize the user model that we've created to create a login process for our website. We'll use the code igniter form helper, database library, and session library.

    I tried something different and recorded the video in HD.  The encoding left the dark background text a bit hard to read, so if I continue to upload HD videos I'll switch to using a white background.  Please let me know if you prefer the old resolution or the HD resolution.

    Download the Source Here

  • Developing a Website with CodeIgniter Part 2: Users Database Table and the User Model

    Sep 6, 2009

    This screencast continues a series with the goal of documenting the development of a functionally complete site using PHP with the CodeIgniter framework and jQuery for Javascript UI improvements including AJAX interactions.

    This video covers the creation of a database table for storing users and the CodeIgniter model class for interacting with it.

    Errata:

    I've noticed a few errors in the screencast. When errors creep up (and they will) I'll audit them as they're discovered and keep this post up to date.  Errors will also be updated during the following screencast.

    1. The UpdateUser method "set password" line (line 80) contains the variable $options['userEmail'] instead of $options['userPassword'].
    2. The UpdateUser method is missing the line $this->db->where('userId', $options['userId']); This should be added before the line that contains $query = $this->db->update('users'); (line 84)
    3. The AddUser method's default value is set incorrectly (line 48). It currently shows array('userStatus', 'active') where it should read array('userStatus' => 'active').

  • AJAX with jQuery: A Simple Login Example

    Apr 15, 2009

    In this screencast we explore the jQuery $.post() command in order to create a simple AJAX login script that also gracefully degrades and works for users who do not have JavaScript enabled.

    You may want to check out my post "What Exactly is JSON?" if you're not familiar with the JavaScript Object Notation before watching.