We just turned 3! 40% off everything with code 3YEARS (excludes workshops and business offerings) Claim offer → Online Workshop Vibe Coding for Production - April 29-30 Register now →
  • Courses
  • Blogs
  • Leaderboard
  • Dometrain Pro
  • Shopping Basket

    Your basket is empty

  • Business Portal
  • Getting Started: Authentication and Authorization in .NET

    Learn how to get started with authentication and authorization in .NET

    About This Course

    Authentication and authorization are two of the most misunderstood topics in .NET, and getting them wrong is one of the fastest ways to introduce a serious security issue into your application. This course is a deep dive into how authentication and authorization actually work in ASP.NET Core, built up from first principles. You'll start with the fundamentals, like the User object, ClaimsPrincipal, and the request pipeline, before moving into the authentication middleware and each of its core operations: Challenge, SignIn, Authenticate, SignOut, and Forbid. From there, we'll go under the hood to explore schemes, authentication tickets, and data protection. There's a full module dedicated to the cookie handler, including event handlers and everything you need to know about cookie and ticket lifetimes. Finally, you'll master authorization, from simple and role-based approaches all the way to policy-based and resource-based authorization, custom requirements and handlers, authorization filters, and view-based scenarios.

    Course Curriculum

    12h 8m 11 sections
    Welcome
    02:33 Free preview
    What will you learn in this course?
    03:03 Free preview
    Who is the course for and prerequisites
    02:53 Free preview
    Course Material
    02:25
    Installing Fiddler
    08:23
    Fiddler and HTTPS
    10:21
    Exploring the starter project
    06:49
    Section Recap
    00:57
    The User Object
    12:28
    Creating a ClaimsPrincipal
    16:28
    The Request Pipeline
    19:08
    Section Recap
    02:13
    Introduction
    14:37
    Authentication Operations
    06:14
    Challenge
    14:54
    SignIn
    08:59
    Authenticate
    22:11
    SignOut
    09:41
    Forbid
    08:32
    Section Recap
    01:25
    Schemes
    17:41
    Authentication Properties.mp4
    12:46
    Authentication Ticket
    17:36
    Data Protection
    08:54
    Section Recap
    02:56
    Introduction
    09:00
    Challenge
    13:39
    SignIn
    24:01
    Authenticate
    06:48
    SignOut
    19:59
    Forbid
    10:48
    Section Recap
    00:52
    Session Cookies
    04:44
    Persistent Cookies
    07:56
    Persistent Cookies Using Max Age
    08:10
    Ticket lifetime
    08:52
    Ticket Renewal
    21:12
    Choosing Cookie and Ticket Lifetime
    18:47
    Section Recap
    01:58
    Challenge Events
    17:14
    SignIn Events
    17:43
    Authenticate Events
    24:30
    SignOut Events
    12:55
    Forbid Events
    15:11
    Section Recap
    02:28
    Introduction
    12:11
    Authorization in ASP.NET Core
    05:36
    Simple Authorization
    10:11
    Role-Based Auth
    18:39
    Policy-Based Auth
    26:05
    Broken Access Control
    21:06
    Section Recap
    01:03
    Requirements and Handlers
    34:52
    Resource-based Authorization
    26:13
    The MVC filter pipeline
    18:43
    Authorization Filters
    20:48
    Custom Authorization Attributes
    10:37
    DefaultPolicy and FallbackPolicy
    19:55
    View-based authorization
    14:37
    Section Recap
    02:13
    Conclusion and next steps
    03:47

    Meet Your Instructor

    Tore Nestenius

    Tore Nestenius

    Tore is a Microsoft MVP in .NET, a senior software architect, and an independent consultant and trainer based in Helsingborg, Sweden. He has over 25 years of experience in professional software development, specializing in ASP.NET Core, web security, OpenID Connect, identity architecture, and Azure. He trains and consults for development teams across Europe and regularly shares his knowledge through his .NET blog. His love for technology goes way back: from a Commodore VIC-20 in 1981 to reverse-engineering a Sega Mega Drive and building his own hardware dev kit as a teenager.
    View all courses by Tore Nestenius

    What's New

    Getting Started: Authentication and Authorization in .NET
    course

    Getting Started: Authentication and Authorization in .NET

    Learn how to add authentication and authorization to your .NET applications with modern patterns and best practices.

    Learn more about Getting Started: Authentication and Authorization in .NET
    AI Code Challenge Generator
    feature

    AI Code Challenge Generator

    Generate unlimited coding challenges with AI. Practice C#, Python, TypeScript, and JavaScript in your browser with instant test feedback.

    Learn more about AI Code Challenge Generator
    Getting Started: Model Context Protocol (MCP)
    course

    Getting Started: Model Context Protocol (MCP)

    Learn how to get started with the Model Context Protocol (MCP) and integrate it into your applications.

    Learn more about Getting Started: Model Context Protocol (MCP)
    Hands-On: Learn TypeScript
    course

    Hands-On: Learn TypeScript

    Learn TypeScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn TypeScript
    Hands-On: Learn JavaScript
    course

    Hands-On: Learn JavaScript

    Learn JavaScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn JavaScript
    Hands-On: Data Structures & Algorithms in C#
    course

    Hands-On: Data Structures & Algorithms in C#

    Master data structures and algorithms through hands-on coding exercises in C#. Free to enroll for 7 days!

    Learn more about Hands-On: Data Structures & Algorithms in C#
    Blogsmith.ai
    feature

    Blogsmith.ai

    Turn your videos into blogs and newsletters with AI. Check out our new product at blogsmith.ai.

    Learn more about Blogsmith.ai
    Leaderboard
    feature

    Leaderboard

    See how you stack up against other learners. Track your progress, climb the ranks, and compete with the Dometrain community.

    Learn more about Leaderboard
    Hands-On: Learn PostgreSQL
    course

    Hands-On: Learn PostgreSQL

    Learn PostgreSQL through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn PostgreSQL
    Free Hands-On: C# for Beginners
    course

    Free Hands-On: C# for Beginners

    Learn C# through hands-on coding exercises. Practice what you learn with interactive challenges designed for everyone, from beginners to experts.

    Learn more about Free Hands-On: C# for Beginners
    Getting Started: AI for .NET Developers
    course

    Getting Started: AI for .NET Developers

    Get started with integrating AI into your .NET applications effectively using the latest LLM best practices.

    Learn more about Getting Started: AI for .NET Developers
    Getting Started: Building .NET Applications on AWS
    course

    Getting Started: Building .NET Applications on AWS

    Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

    Learn more about Getting Started: Building .NET Applications on AWS
    What's new in C# 14
    blog

    What's new in C# 14

    This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

    Learn more about What's new in C# 14
    Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    course

    Let's Build It: AI Chatbot with RAG in .NET Using Your Data

    Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

    Learn more about Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    From Zero to Hero: SignalR in .NET
    course

    From Zero to Hero: SignalR in .NET

    Enable enterprise-grade real-time communication for your web apps with SignalR.

    Learn more about From Zero to Hero: SignalR in .NET
    Deep Dive: Solution Architecture
    course

    Deep Dive: Solution Architecture

    Master solution architecture and turn business needs into scalable, maintainable systems.

    Learn more about Deep Dive: Solution Architecture
    Migrating: ASP.NET Web APIs to ASP.NET Core
    course

    Migrating: ASP.NET Web APIs to ASP.NET Core

    A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

    Learn more about Migrating: ASP.NET Web APIs to ASP.NET Core
    Getting Started: Caching in .NET
    course

    Getting Started: Caching in .NET

    Let's make the hardest thing in programming easy for .NET software engineers.

    Learn more about Getting Started: Caching in .NET
    From Zero to Hero: Testing with xUnit in C#
    course

    From Zero to Hero: Testing with xUnit in C#

    Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

    Learn more about From Zero to Hero: Testing with xUnit in C#
    Create a ChatGPT Console AI Chatbot in C#
    blog

    Create a ChatGPT Console AI Chatbot in C#

    This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

    Learn more about Create a ChatGPT Console AI Chatbot in C#