API KEY Authentication and Authorization in .NET (The right way)

preview_player
Показать описание
API Key authentication is everywhere, but in #dotnet I've seen bad practices...

One widespread and lately taught around is using Authorization Filters to perform Authentication.
PLEASE, don't do it! Why?
You don't leave the front of your house open, and just ask who is around when they reach your bedroom door, or your living room right?

Same with your APIs, that's why I created a sample project you can access the code in full to see how to implement API Key in the right way, with READ/WRITE permissions.
The code is structured to differentiate between Authentication and Authorization, which is extremely important to understand at all levels of seniority.

6 words cheatsheet:

AUTHENTICATION (WHO) = MIDDLEWARE
AUTHORIZATION (WHAT) = FILTERS

The code can be found here

Join this channel to get the latest updates on
#dotnetprogramming
#cqrs
#dependencyinjection
#refactoring
#linux
@dariogriffo

Рекомендации по теме
Комментарии
Автор

Loved this! Great explanation.
Always so clear in your videos

AndiGriffo
Автор

thanks for the clear explanation of the Authentication process my friend 👌

ebrahimmansur
Автор

Greate. But the code link is not working.

rhexcasas