Building and Securing Restful APIs in .NET

Building and Securing Restful APIs in .NET

2h 49mAdvanced2024-06-04

Authors

Matt Milner

Matt Milner

Independent Consultant, Web Developer, Trainer

Course details

Most people have heard of REST APIs, but the underlying concept—representational state transfer (REST)—can still cause a good deal of confusion. RESTful APIs use REST architecture along with HTTP requests to transfer data and changes in application state between clients and servers. This course shows you how to apply the principles of REST while building secure RESTful APIs on top of ASP.NET.

Join instructor Matt Milner as he provides an overview of how to get up and running with RESTful design in ASP.NET. Learn how to create APIs, entities, and databases, as well as work with resources, add link support, and configure and enable authentication options. By the end of the course, you should know the basics—how to properly request and return data in ASP.NET—and the best practices for building secure and scalable APIs to serve web clients, mobile clients, and beyond.

Skills covered

.NETAPIsAdvancedFull-Stack Web DevelopmentSoftware Development ToolsWeb DevelopmentMicrosoftSoftware Development

Concepts

Introduction

  • Introduction to RESTful APIs in .NET
  • What you should know
  • Exercise files

REST in ASP.NET

  • REST level set
  • Creating the API project
  • Creating the database entities
  • Creating and seeding the database
  • Defining the resources
  • Mapping resources and entities
  • Setting up the resource controller
  • Set up the HTTP test file

Working with Resources

  • Defining URI templates
  • Implement resource collection GET
  • Implement resource GET
  • Implement resource POST
  • Implement resource PUT
  • Implement resource PATCH
  • Implement resource DELETE
  • Review additional resource operations

Adding Link Support

  • HATEOAS and the API root
  • Create a link base class
  • Update resource with link support
  • Validate linking support
  • Industry linking formats

API Authentication

  • Authentication options
  • Securing the data in transit and at rest
  • Securing APIs with API key
  • Checking for API keys
  • Securing APIs with a token
  • Enabling ASP.NET Identity for APIs
  • Enforcing and validating token identity
  • Testing identity APIs
  • Using proxies for authentication
  • Using OAuth providers for tokens

API Authorization

  • Defining security policies
  • Creating a security policy for write operations
  • Applying the security policy

Conclusion

  • Next steps
80,000 Toman