
Explore building a Django and Angular authentication system with login, registration, two-factor authentication, Google login, token-based sessions, and password reset workflows.
Four projects cover authentication with tokens, two-factor and Google login; admin image uploads and export; basado with Docker Redis Stripe; ambassador toward microservices with Kafka and Kubernetes.
Install Python from python.org and Django with the Django Rest Framework quickstart, then create an empty project and run the server on port 8000.
Connect to a local my school database named jungle oath, test the connection, and populate it by running a command; configure root on localhost port 3306 and prepare for migrations.
Extend Django's user model to add first and last name, unique email, and no username login; set default user to core model and run migrations to create the user table.
Create a register API view to handle post requests for user registration, wire it to api/register, and test with a post request to localhost:8000/api/register.
Create a user serializer extending model serializer to expose id, first name, last name, email, and password; validate password confirmation and save, and prevent returning passwords in the API.
Learn serializer methods to securely create a Django user by popping the password from validated data, hashing it with set_password, and saving the instance without exposing the password.
Implement a login api view that accepts email and password, validates the user with check_password, and returns serialized data.
Create jwt-based authentication by generating access and refresh tokens (30 seconds and seven days) from user id payload, and store the refresh token in a cookie the frontend cannot access.
The lecture explains cors errors on a different port and guides installing Jungle Course Headers, adding middleware, and configuring cors origin and credentials to deliver access tokens and cookies.
Fetch the authenticated user by sending the access token in the authorization header, decode the JWT to extract the user id, and serialize the user data for the response.
Implement a JWT authentication middleware in Django REST framework by extending the base authentication and overriding authenticate to return the user from the authorization header.
Implement logout by deleting the refresh token cookie via API view, verify unauthenticated responses when the cookie is missing, and note a security gap to address in the next story.
Create a user token model to store refresh tokens with created at and expired at fields. Logout deletes the token record and clears cookies for secure revocation.
Implement a password reset flow by creating a reset model with email and a unique token, and build a post endpoint to store the token.
Configure mail hook to send reset password emails from Django, using send_mail with a reset URL and token; test by Postman and view messages in the Mail Hook interface.
Create a post-based reset password API view that validates the new password and token. Retrieve the user by email and update the password, returning success or invalid link.
Learn how to implement a Django exception handler that intercepts responses and converts 403 forbidden to 401 unauthorized via a status code handler, with settings and frontend considerations.
Create and run an Angular frontend with routing, integrate Bootstrap for a sign-in form, customize the email component, apply global styling, and prepare additional components for future lessons.
Learn how to create Angular components with schematics, organize them into pages, auto-update the model and declarations, and set up navigation as you build login, register, and home components.
Add a navigation header and set up routes for home, login, and register components using router outlet and router links, enabling seamless navigation across the app.
Build a user registration form using Angular reactive forms, importing the module and form builder to create a form group with first name, last name, email, password, and confirm.
Register a user by posting form data to the API register endpoint, then navigate to the login page. Refactor code into a dedicated authentication service with a configurable environment prefix.
Learn to implement a secure login flow in Angular by posting email and password, handling access and refresh tokens, enabling cookies with credentials, and preparing interceptors for future use.
Learn how interceptors attach a bearer token to every request by cloning requests and adding an authorization header, enabling authenticated user retrieval and error handling in Angular.
Learn to handle unauthenticated 401 errors by intercepting them, refreshing the access token with a refresh token, and retrying the original request with a cloned header.
Implement logout by posting to logout with credentials to clear the refresh token cookie, update the authenticated state, and prevent multiple refresh calls with a refresh flag.
Implement a singleton event emitter in the authentication service. Broadcast a boolean authenticated state and subscribe in home and components to update UI on login and logout.
Implement a forgot password flow by creating a forgot component and service, posting the user email to api/forgot, and displaying success or error notifications with an email reset link.
Learn to implement a password reset flow with token handling in a Django and Angular setup, building a reset component, form with password and password confirm, and navigation to login.
Implement a two-factor authentication flow by retrieving or generating a user secret, returning a QR code URL for scanning, verifying the code, and issuing tokens upon login.
Refactor the logging component to support two factor authentication by adding a login form and an authenticator form, using an event emitter to pass user id and QR code.
Configure and finalize the authenticator form, send login data and a six-digit code, and display a QR code from the response to complete two-factor authentication.
Master Google authentication in Django and Angular by creating credentials, verifying tokens via a Google health API view, and issuing access and refresh tokens.
Implement Google login in Angular using the angular egg social login package, configure the Google provider, and handle the token to authenticate with the backend.
Welcome to this course where you will learn everything you need to know to secure your Angular and Django app.
In Django you will learn:
Use Django Rest Framework
Connect Django with MySQL
Use Access & Refresh Tokens
Use HttpOnly Cookies
Send Emails
Login using 2 Factor Authentication (2FA) with Google Authenticator
Social Authentication using your Google Account
In Angular you will learn:
Use Angular CLI
Create components and routes
Consume API calls
Use Event Emitters
Create QRCodes
Social Authentication using your Google Account
If these are what you are looking for then this course is for you.
I'm a FullStack Developer with 10+ years of experience. I'm obsessed with clean code and I try my best that my courses have the cleanest code possible.
My teaching style is very straightforward, I will not waste too much time explaining all the ways you can create something or other unnecessary information to increase the length of my lectures. If you want to learn things rapidly then this course is for you.
I also update my courses regularly over time because I don't want them to get outdated. So you can expect more content over time from just one course with better video and audio quality.
If you have any coding problems I will offer my support within 12 hours when you post the question. I'm very active when trying to help my students.
So what are you waiting for, give this course a try and you won't get disappointed.