Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Enterprise Application Development with C# 10 and .NET 6

You're reading from   Enterprise Application Development with C# 10 and .NET 6 Become a professional .NET developer by learning expert techniques for building scalable applications

Arrow left icon
Product type Paperback
Published in Jun 2022
Publisher Packt
ISBN-13 9781803232973
Length 586 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (4):
Arrow left icon
Ravindra Akella Ravindra Akella
Author Profile Icon Ravindra Akella
Ravindra Akella
Arun Kumar Tamirisa Arun Kumar Tamirisa
Author Profile Icon Arun Kumar Tamirisa
Arun Kumar Tamirisa
 Kumar Kunani Kumar Kunani
Author Profile Icon Kumar Kunani
Kumar Kunani
Bhupesh Guptha Muthiyalu Bhupesh Guptha Muthiyalu
Author Profile Icon Bhupesh Guptha Muthiyalu
Bhupesh Guptha Muthiyalu
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part 1: Fundamentals
2. Chapter 1: Designing and Architecting the Enterprise Application FREE CHAPTER 3. Chapter 2: Introducing .NET 6 Core and Standard 4. Chapter 3: Introducing C# 10 5. Part 2: Cross-Cutting Concerns
6. Chapter 4: Threading and Asynchronous Operations 7. Chapter 5: Dependency Injection in .NET 6 8. Chapter 6: Configuration in .NET 6 9. Chapter 7: Logging in .NET 6 10. Chapter 8: All You Need to Know about Caching 11. Part 3: Developing Enterprise Applications
12. Chapter 9: Working with Data in .NET 6 13. Chapter 10: Creating an ASP.NET Core 6 Web API 14. Chapter 11: Creating an ASP.NET Core 6 Web Application 15. Part 4: Security
16. Chapter 12: Understanding Authentication 17. Chapter 13: Implementing Authorization in .NET 6 18. Part 5: Health Checks, Unit Testing, Deployment, and Diagnostics
19. Chapter 14: Health and Diagnostics 20. Chapter 15: Testing 21. Chapter 16: Deploying the Application in Azure 22. Other Books You May Enjoy

Claims-based authorization

A claim is a key-value pair associated with identity after successful authentication. A claim can be a date of birth, gender, or zip code, for example. One or more claims can be assigned to a user. Claims-based authorization uses the value of a claim and determines whether access to a resource can be granted or not. You can use two approaches to validate a claim; one way is to just check whether the claim exists or not and the other approach is to check whether the claim exists with a particular value.

To use claims-based authorization, we need to register a policy in Program.cs. You need to pass a claim name and optional values to the RequireClaim method to register. For example, the following code registers PremiumContentPolicy with the requirement of the PremiumUser claim:

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAuthorization(options =>
{
    options.AddPolicy("PremiumContentPolicy...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Enterprise Application Development with C# 10 and .NET 6
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon