Skip to content
0:00 / 0:00

#asp.netcore#api-key#authentication

Setting up ApiKey-based Authentication | ASP.NET Core 5 REST API Tutorial 24

Nick Chapsas

429K subscribers • 62 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Nick Chapsas
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

72K views7 years ago1 recommendation

SecurityWeb developmentC# and .NETHTTP, REST and GraphQLWeb and application security

Nick Chapsas shows how to implement API key authentication in ASP.NET Core using a custom attribute.

Become a Patreon and get source code access: patreon.com/nickchapsas Check out my courses: dometrain.com Hello everybody I'm Nick and today I will show you how you can set up ApiKey-based authentication in your ASP.NET Core 3 or 2.2 Api. This is not a REST API specific thing and you can do it across any ASP.NET Core project. We will follow the very simple approach of using a custom attribute for this. Don't forget to comment, like and subscribe :) Social Media: Follow me on GitHub: bit.ly/ChapsasGitHub Follow me on Twitter: bit.ly/ChapsasTwitter Connect on LinkedIn: bit.ly/ChapsasLinkedIn #tutorial #rest #api

Why it's here

1 person recommends this

u/Elfocrashin r/dotnet • Recommends

Setting up ApiKey-based Authentication | ASP.NET Core 3 & 2.2 REST API Tutorial 24

u/ranblain r/dotnet • Mentions

On “[Question] How can I return a 401 Unauthorized status code instead of redirect to the login page when using an Api Controller in ASP.NET Core 3.1?”

I recently did this with a web api I created. I used an actionfilter to check the request header for the presence of the api key and then validate it. I believe I used the information in this video to set this up.