Implement API Key Authentication in ASP.NET Core Web API

  Рет қаралды 3,606

Code Maze

Code Maze

4 ай бұрын

►► Master Web API development Best Practices: bit.ly/3TnqoFQ
►► Build great web apps in Blazor WebAssembly: bit.ly/437g87T
►► Support us on Patreon and get the source code: / codemaze
In this video, I’ll show you different ways to implement API key authentication in the .NET Web API project.
When we use the API key for the authentication, there are Different Ways of Passing it in a Request
We can use:
-Query Parameters
-Request Body
-Request Headers
In this video, I will only use the Headers option to pass the API key to the web API.
Besides the different ways to pass the API key to an endpoint, there are also different approaches to implementing API key authentication in ASP.NET Core. We can use:
-Custom Attribute
-Custom Middleware
-Endpoint filters with minimal APIs and
-Policy-based Authorization
I will show you all these approaches in this video.
LINKS MENTIONED IN THE VIDEO
►► Different Ways to Pass Parameters in .NET: • Different Ways to Pass...
FOLLOW US ON SOCIAL MEDIA!
►► / marinko-spasojevic
►► / codemazeblog
►► / codemazeblog

Пікірлер: 8
@CodeMaze
@CodeMaze 3 ай бұрын
Thank you all for watching and for your support. ►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM ►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33
@leventtugaykaplan3592
@leventtugaykaplan3592 4 ай бұрын
Awesome!!!
@CodeMaze
@CodeMaze 4 ай бұрын
Thanks a lot.
@ugochukwuumerie6378
@ugochukwuumerie6378 4 ай бұрын
Awesome video. Can it be possible to pass the api key as bearer tokens on the authorization header instead of the x-api-key header during the request? Thank you
@CodeMaze
@CodeMaze 4 ай бұрын
Hi. Thank you for watching and for the kind words. Regarding your question. Yes, you can do that and for that I would use the Policy-based auth. Then inside the Authorization header of the Postman, you can send it using two ways. Either as a bearer token - but keep in mind that the header name is different and the "Bearer" will be appended to your token. Or, you can send it as an API Key (also inside the authorization header), and then you can provide the header name and the content of the API key.
@ugochukwuumerie6378
@ugochukwuumerie6378 4 ай бұрын
@@CodeMaze Thank you
@eclecticx
@eclecticx 2 ай бұрын
Is the source code on github? Link?
@CodeMaze
@CodeMaze 2 ай бұрын
Hi. All the source code for each video with some other benefits are part of the patreon package. The link is in a description of the video.
API Key Authentication Best Practices
25:56
Zuplo
Рет қаралды 21 М.
CRUD with the Blazor WebAssembly Render Mode in .NET 8 🔥
50:49
MEU IRMÃO FICOU FAMOSO
00:52
Matheus Kriwat
Рет қаралды 30 МЛН
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 64 МЛН
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 38 МЛН
How to Implement ASP.NET Core Web API Versioning in
12:57
Code Maze
Рет қаралды 2,8 М.
.NET 8 Real Life Application Initial Solution Design
25:01
huzcodes
Рет қаралды 1 М.
The Best Way to Add Health Checks in Any .NET App
12:31
Nick Chapsas
Рет қаралды 87 М.
Background Jobs in ASP.NET Core
18:35
IAmTimCorey
Рет қаралды 46 М.
Implementing In-Memory Caching in ASP.NET Core Applications
16:58
Top 20 Interview Questions - Web API - .NET C#
42:22
Interview Happy
Рет қаралды 194 М.
MEU IRMÃO FICOU FAMOSO
00:52
Matheus Kriwat
Рет қаралды 30 МЛН