Secure APIs with FastAPI and the Microsoft Identity Platform Course

Course Summary

Azure Active Directory (Azure AD) is a cloud-based Identity and Access Management service from Microsoft. With security threats on the rise it’s important to know how to build secure solutions with robust authentication and authorization services to protect your data. In this course we will introduce basic identity principals and learn how to use Azure AD to enforce who and how they can access our Fast APIs using open industry standards such as OAuth2 and OIDC.

If you are a Python developer that wants to know how to implement secure, JWT-based authentication and authorization by leveraging a scalable, secure and flexible identity provider such Azure AD, then this course is for you. You will learn how to secure your APIs without the need to write too much code or having intricate knowledge on how OAuth2 and OIDC work. A plug and play solution for every Python developer and solution architect out there.

What students are saying

I just finished a course on the Talk Python Training website. Just wanted to say thank you for producing such outstanding and easy to follow content. I learned a great deal in a short amount of time!
-- Fisher A.

What's this course about and how is it different?

Identity and security are complex topics. Your solution is as secure as the weakest link in your code. Instead of spending weeks or even months building an identity solution for your application, it’s highly recommended that you use a battle-tested Identity Provider such as Azure Active Directory. Azure AD handles billions of authentications daily and scales from 1 user to millions users without you having to think about performance, storage, backups, and availability.

This is the only course (that we’re aware of) that shows you how to add authorization to your Fast API and implement strict checks on JWT Access Tokens to validate incoming requests. In this course, you’ll learn how end-to-end scenarios work in real life scenarios by building clients that can securely authenticate and call our FastAPI-based application. Finally, you'll spend some time learning general identity principles and do a deep dive on why and how JWT-based authentication is more secure.

After completing this course, you’ll have a robust understanding of how to build modern, secure solutions with Python, FastAPI, and Azure Active Directory.

Prerequisite course

While the code written in this course is simple and you only need basic fluency with Python, we do assume you know FastAPI. If you're entirely new to FastAPI, please consider taking our Modern APIs with FastAPI and Python to become comfortable with FastAPI first.

What topics are covered?

In this course, you will:

  • Learn what Identity is and why modern solutions need to know who we are and what we can do.
  • Understand modern authentication and why we needed open standards such OAuth2 and OpenID Connect (OIDC).
  • Learn how to create and work with Microsoft Azure Active Directory.
  • Take a look at the microsoft_identity_fastapi package built specifically to perform authorization and token validation in FastAPI-based solutions.
  • Dive deep into JWT-based authentication and better understand tokens and claims.
  • And lots more.

  • View the full course outline.

Who is this course for?

This course is for anyone who creates APIs with the FastAPI framework in Python and needs to add the necessary security to protect access to sensitive resources and data but doesn’t want to (and shouldn’t have to) build and maintain their own identity service. A key benefit of this approach is that you need to do very little to implement authentication and authorization in FastAPI - it’s literally a few lines of code and some configuration and you’re ready to go.

The experience level for anyone taking this course is very light high. You’ll need:

  • A basic understanding of how Fast API works.
  • Experience with core Python concepts (such as classes, functions, variables etc).
  • Knowledge of API clients such as Postman etc.

Note: All software used during this course, including editors, the Azure AD service, Python language, etc., are 100% FREE. You won't have to buy anything to take the course.

Follow along with subtitles and transcripts

Each course comes with subtitles and full transcripts. The transcripts are available as a separate searchable page for each lecture. They also are available in course-wide search results to help you find just the right lecture.

Each course has subtitles available in the video player.

Who am I? Why should you take my course?

Who is Christos Matskas? Hi everyone, my name is Christos and it’s nice to meet you.

There are a couple of reasons why I’m especially qualified to teach you about security and identity.

  1. I’m a senior PM at Microsoft where I work as developer advocate with a special focus on helping developers and enterprises of any size to build robust, scalable and, most of all, secure solutions. I’m particularly passionate about security and this is why I want to help the developer community.

  2. I’ve been a professional developer for almost 20 years. I have worked with 1000s of companies of every size building all types of software and teaching developers how to follow best practices.

  3. I’m not here to sell you anything. Although I work for Microsoft, the principals taught in this course are based on open standards and are transferable to other cloud providers and platforms.

  4. I hope that you’ll appreciate and enjoy my course and even if you don’t, I’m always happy to hear your feedback and suggestions on how I can make it better for you.

Free office hours keep you from getting stuck

One of the challenges of self-paced online learning is getting stuck. It can be hard to get the help you need to get unstuck.

That's why at Talk Python Training, we offer live, online office hours. You drop in and join a group of fellow students to chat about your course progress and see solutions via screen sharing.

Just visit your account page to see the upcoming office hour schedule.

This course is delivered in very high resolution

Example of 1440p high res video

This course is delivered in 1440p (4x the pixels as 720p). When you're watching the videos for this course, it will feel like you're sitting next to the instructor looking at their screen.

Every little detail, menu item, and icon is clear and crisp. Watch the introductory video at the top of this page to see an example.

Is this course based on Python 3 or Python 2?

This course is based upon Python 3. Python 2 is officially unsupported as of January 1st, 2020 and we believe that it would be ill-advised to teach or learn Python 2. This course is, and has always been, built around Python 3.

The time to act is now

If you need a more modern way to authentic API clients than simple username and password or api key schemes, this course is for you. Especially if you're focused on the Microsoft cloud stack or Azure Active Directory. Take the course today!

Course Outline: Chapters and Lectures

Welcome to the course
4:53
Welcome
1:19
API security
1:19
Your instructor
1:01
More on FastAPI and Microsoft Identity
1:14
Introduction to Identity
15:34
What is identity?
3:17
Username and password databases
3:19
Introduction to the OAuth2 protocol
3:36
Introduction to the OIDC protocol
2:04
Identity-as-a-service
3:18
Building a Secure API
20:38
Introduction to Azure Active Directory (Azure AD)
2:24
Provisioning an Azure AD tenant
4:59
Creating your first application registration
5:00
Securing FastAPI with Azure AD
8:15
Web and headless clients
31:54
Application types
3:27
Demo: Building a console app that calls a secure FastAPI API
15:19
Demo: ASP.NET Core web app consuming a FastAPI API
13:08
JSON Web Token (JWT) Authentication
26:28
Benefits of JWT authentication
4:35
The anatomy of JWTs and token validation
11:24
Secure authentication with self-signed certificates
6:23
Handling authentication and authorization errors
4:06
Course conclusion and review
4:49
You've made it!
0:34
Review: Introduction to the Microsoft Identity Platform
0:58
Review: Securing FastAPI with Microsoft Identity
1:25
Review: Calling our secure FastAPI
0:50
Review: JWT-based authentication
0:33
Thanks and congrats
0:29
Buy for $39 + tax Bundle and save 85% Team Gift

Questions? Send us an email: contact@talkpython.fm

Talk Python's Mastodon Michael Kennedy's Mastodon