Getting Started: Authentication and Authorization in .NET

Learn ASP.NET Core authentication and authorization at your own pace. You see what happens when a user signs in, and how you decide what they get access to.

Back to Workshops

Who Is This Course For?

This video course is for .NET developers who build on ASP.NET Core and want to understand how it handles sign-in, cookies and access control under the hood. It is also for:

  • Developers moving from ASP.NET Framework to ASP.NET Core.
  • Backend developers who are responsible for the security of web applications.
  • Developers who plan to use ASP.NET Core Identity, OAuth or OpenID Connect and want to learn the foundation first.

Prerequisites

  • Basic knowledge of ASP.NET Core
  • A solid understanding of C#, including LINQ and lambda expressions
  • An understanding of HTTP/HTTPS and web fundamentals

What You’ll Be Able To Do

After the course, you can:

  • Implement cookie authentication from scratch, without black-box libraries
  • Create ClaimsPrincipal and ClaimsIdentity objects to represent users
  • Follow how the authentication middleware processes each request, and use its five operations
  • Explain authentication schemes, tickets and how the cookie handler works inside
  • Set cookie and ticket lifetime, persistence and renewal
  • Customize the cookie handler with event handlers
  • Apply role-based, policy-based and resource-based authorization, with your own requirements and handlers
  • Debug authentication flows with Fiddler
  • Protect your applications against broken access control

What the Course Does Not Cover

The course does not cover external sign-in providers (Google, Facebook, Microsoft), OAuth, OpenID Connect or ASP.NET Core Identity. They are all built on the layer this course teaches, so this is the foundation to learn first.

Course Agenda

  1. Course overview Welcome; What will you learn in this course?; Who is the course for and prerequisites
  2. Getting Started Course Material; Installing Fiddler; Fiddler and HTTPS; Exploring the starter project
  3. Fundamentals The User Object; Creating a ClaimsPrincipal; The Request Pipeline
  4. The Authentication Middleware Introduction; Authentication Operations; Challenge; SignIn; Authenticate; SignOut; Forbid
  5. The Authentication Internals Schemes; Authentication Properties; Authentication Ticket; Data Protection
  6. The Cookie Handler Introduction; Challenge; SignIn; Authenticate; SignOut; Forbid
  7. Cookie and Ticket Lifetime Session Cookies; Persistent Cookies; Persistent Cookies Using Max Age; Ticket lifetime; Ticket Renewal; Choosing Cookie and Ticket Lifetime
  8. Cookie Event Handlers Challenge, SignIn, Authenticate, SignOut and Forbid Events
  9. Authorization Introduction; Authorization in ASP.NET Core; Simple Authorization; Role-Based Auth; Policy-Based Auth; Broken Access Control
  10. Advanced Authorization Requirements and Handlers; Resource-based Authorization; The MVC filter pipeline; Authorization Filters; Custom Authorization Attributes; DefaultPolicy and FallbackPolicy; View-based authorization
  11. Course conclusion Conclusion and next steps

Next Step

If you want to go further with OAuth 2 and OpenID Connect, my video course Getting Started: OpenID Connect, also on Dometrain, is a good follow-up to this one.

Want This for Your Whole Team?

I also teach this topic as a live two-day workshop, on-site or remote, with time for your team’s own questions and code. See my workshop Authentication and Authorization in ASP.NET Core.

Get in touch

Contact