Building a PHP Authentication System
Video Lectures
Displaying all 33 video lectures.
Lecture 1![]() Play Video |
Introduction Build a PHP authentication system featuring registering, logging in, remembering users, resetting passwords, updating profiles and more. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 2![]() Play Video |
Dependencies To help us along the way, we need a few project dependencies. This includes our base framework, Slim 2, and various other packages so we can develop quickly and efficiently. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 3![]() Play Video |
Setting Up Let's define some project structure and boot up our Slim app! Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 4![]() Play Video |
Configuration We need to easily pull configuration in throughout our project. We also need to be able to switch between different configuration modes so we can seperate development and live settings. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 5![]() Play Video |
Users Table We need a database table to store our registered users. Here, we create the table in a MySQL database. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 6![]() Play Video |
Adding Database Support We're adding database support through Models with Eloquent. This allows us to create our User model later and create, updated and find user records. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 7![]() Play Video |
User Model Our User model will serve as every way to handle users, from creating, updating and finding records, to creating relationships between users and other models. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 8![]() Play Video |
Routes & Views Creating our first view to show the homepage, and dealing with our project templates. We're using Twig as our template engine. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 9![]() Play Video |
Flashing Messages Flashing messages allows us to show a message to inform a user something has happened, e.g. "You have just been registered". We'll be using this throughout the system, so here we look at how to do this. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 10![]() Play Video |
Password Hashing Passwords need to be stored hashed in our database, so we're going to build a Hash helper to easily hash passwords using the PHP Password Hashing API. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 11![]() Play Video |
Registering Finally, we arive at being able to register a user via an HTML form, insert a record in the database and tell them they've registered. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 12![]() Play Video |
Validation Validation is a massive part of any project, so here we implement a validation class that extends Violin, the package we're using to easily validate anything a user posts. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 13![]() Play Video |
Unique Emails/Usernames Validating the email and username to check if they already exist in the database. If they do, we want to display an error through our normal validation process. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 14![]() Play Video |
Logging In It's time to allow our users to log in! This involves creating the form, setting sessions and modifying our container so our system knows a user is authenticated. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 15![]() Play Video |
Sending Email Sending email is an important part of any application, so here, we set up the ability to send emails easily. We'll also use views for our email content, making it easier and cleaner to define what we want to send. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 16![]() Play Video |
Email Templates Email templates allow us to define a common template for all emails, making it easier to design and include partials. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 17![]() Play Video |
Hashing & Random Strings Setting up the ability to generate long random strings and hashing so we can enfore a higher level of security in our authentication system. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 18![]() Play Video |
Account Activation Building in the requirement for a user to activate their account by email. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 19![]() Play Video |
Filters Filters allow us to easily protect routes from non-authenticated users, and stop authentication users accessing pages like /login and /register when they're logged in. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 20![]() Play Video |
CSRF Protection Cross-site Request Forgery (CSRF) protection prevents a user having a form submitted on their behalf by someone outside of our website. Here, we set it up and add it to our register and login forms. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 21![]() Play Video |
Logging Out Naturally, we need to allow authenticated users to log out of their account, so we're going to implement a simple route for them to do so. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 22![]() Play Video |
Profile Pictures Displaying user avatars from Gravatar, a service that allows avatars to be used globally accross different websites. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 23![]() Play Video |
Remember Me Allowing users to be remembered by checking 'remember me' when they log in. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 24![]() Play Video |
User Profile Displaying a user profile for any registered user. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 25![]() Play Video |
List All Users Listing all of the registered users on one page, so we can click through and view their profiles. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 26![]() Play Video |
User Permissions Allowing users to have simple individual permissions. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 27![]() Play Video |
Custom 404 Page Up until now, we've been seeing the default Slim 404 page. Let's create our own. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 28![]() Play Video |
Change Password Building in the ability for a signed in user to change their password, ensuring we check their old password matches. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 29![]() Play Video |
Forgot Password If a user forgets their password, we can start a recovery process which emails them, prompting them to click a link to change their password. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 30![]() Play Video |
Update User Profile Allow users to update their profile details (even settings, if you add them). Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 31![]() Play Video |
Fix Signing In For Inactive Users Users can currently sign in with their username (not their email) if they haven't activated their account. In this video, we fix that up. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 32![]() Play Video |
Fix Returning When Redirecting Returning a redirect request within our routes so we don't run into any redirection trouble. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |
Lecture 33![]() Play Video |
Better Email Support We move away from PHPMailer to a 3rd party solution for sending email. Subscribe here for more tutorials: http://www.youtube.com/subscription_center?add_user=phpacade... Our channel http://youtube.com/phpacademy Official website http://phpacademy.org Support Forum http://phpacademy.org/forum Follow us on Twitter! http://twitter.com/phpacademy |