Загрузка страницы

ASP.NET Core Authentication with JWT (JSON Web Token)

Authentication is the process that helps identify who is the users. On the other hand, authorization is the process of determining what a user can do. For authorization to work, the user will be authenticated first. We need the user’s identity to identify the role of a user and act accordingly.

Authentication middleware is responsible for authentication in ASP.Net Core applications. The authentication middleware uses the registered authentication handlers to authenticate a user. The registered handlers and their associated configurations are called schemes.

In ASP.Net Core, the authentication middleware is added in the Startup class, inside the Configure method. It is done by calling UseAuthentication method on the IApplicationBuilder instance passed to the method.

Authentication schemes are registered in the Startup class inside of the ConfigureServices method. It is done by calling AddAuthentication method on the IServiceCollection instance passed to the method. We can register multiple authentication schemes, whereas only one of them will be a default scheme.

What is JWT
JWT stands for JSON Web Token. JWT is JSON based access token created for claims. It is a self-contained and compact standard for access token to securely transfer claims.

For our project, we will use JWT. For creating a JWT, we can use different hash algorithms. We will use HS256 algorithm for this project.

Blog: https://dotnetcorecentral.com/blog/authentication-handler-in-asp-net-core/

Видео ASP.NET Core Authentication with JWT (JSON Web Token) канала DotNet Core Central
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
30 декабря 2019 г. 20:59:43
00:26:09
Яндекс.Метрика