Тёмный

Create Asp.Net Core Web API With JWT Role Based Authorization Using Identity Framework From Scratch 

FreeTrained
Подписаться 15 тыс.
Просмотров 7 тыс.
50% 1

In this video, we'll create role based authorization in Asp.Net Core Web API using Identity Framework from scratch in .Net 8.
It is very useful when there are multiple users your app and you don't want every user to have access to everything.
Using Role Based Authorization, you can restrict the access of users to unwanted areas on your app. User would only be able to access the areas which are allowed according to their roles.
-------------------------------------------------------------------------------------
Upgraded Version of this API:
Create Role Based User Management API Using Dynamic Policies In Asp.Net Core Web API: • Create Role Based User...
-------------------------------------------------------------------------------------
You'll Learn To:
Implement Identity Framework
Implement Identity User
Handle Authentication
Handle Authorization
Customize Json Web Token Parameters
Generate Json Web Tokens
Create Custom Registration Method
Create Custom Login Method
Create Add Role Method
Create Assign Role To User Method
Use Postman For Testing
-------------------------------------------------------------------------------------
Source Code: github.com/FLD...
-------------------------------------------------------------------------------------
Connection String:
"ConnectionStrings": {
"Default": "Server=[ServerName];Database=[DatabaseName];Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=true"
},
-------------------------------------------------------------------------------------
Time Stamps:
00:07 Create Project
00:39 Import Required Packages
01:59 Create Required Folders
02:10 Create Login Model
02:41 Create Register Model
03:18 Create User Role Model
03:48 Create AppDBContext Class
04:13 Add AppDbContext Class In Program.cs File
04:49 Add Connection String
05:15 Add "Add Identity" Middle-ware
06:07 Add "Add Authentication" Middle-ware
08:49 Add "Add Authorization" Middle-ware
09:00 Add Policies
09:46 Create Account Controller
10:53 Create Register Method
12:17 Create Login Method
16:46 Create Add Role Method
18:45 Create Assign Role Method
20:31 Create Admin Controller
21:16 Create User Controller
21:46 Create Migrations
22:02 Create Database
22:41 Testing
24:37 Fixing Error
25:04 Testing Again
-------------------------------------------------------------------------------------
I hope, you'll like this video. If you have any question related to this video then ask in comments section without any hesitation.
Also Don't forget to like this video and also share it with your friends. Also don’t forget to subscribe our channel and also hit that notification bell to get the notification of our latest video.
-------------------------------------------------------------------------------------
Join WhatsApp Channel: whatsapp.com/c...
Check out our website: www.freetraine...
Facebook Page Link: / free_trained
Facebook Group Link: / 1746009532359857
Please Subscribe Our RU-vid Channel For More interesting Videos And Don't Forget To Share Our Channel With Your Friends.
Note: *Please Turn Off Any Ad Blocker Software or add-on to support us.
-------------------------------------------------------------------------------------
Tags:
#aspnetcore #aspnetcorewebapi #dotnet #api #webapi #programming
-------------------------------------------------------------------------------------
Almost in F - Tranquillity by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. creativecommon...
Source: incompetech.com...
Artist: incompetech.com/

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@Sharondevbd
@Sharondevbd Месяц назад
Best Basic & Clear Concept of Role Based Video Ever ! Love you bro ❤
@mahmoudhomsi611
@mahmoudhomsi611 10 часов назад
Very well explained, everything structured and step by step.
@rifatislamrakesh
@rifatislamrakesh 3 месяца назад
thanks for the tutorial. it was to the point and straight forward.
@maratha_empire003
@maratha_empire003 4 часа назад
1:56 If you explain why we need the installed packages and usage of every package it would be great to know and grasp the knowledge. can you do it here...? it will be very helpful
@Shmaisanimostafa
@Shmaisanimostafa 26 дней назад
Great tutorial!
@harmony-teams
@harmony-teams 3 месяца назад
Awesome tutorial thanks. What kind of tool/service did you use for your sound ?
@FreeTrained
@FreeTrained 3 месяца назад
I mostly use Metavoicer.
@venkatachakrapaninandi7045
@venkatachakrapaninandi7045 2 месяца назад
It's a great tutorial. It should be rate 4.5 stars
@FreeTrained
@FreeTrained 2 месяца назад
Thanks for rating 😁👍🏻
@ezansaleem13
@ezansaleem13 3 месяца назад
thanks for this video and I have a request to please use the react as a front end and use this API with it.
@FreeTrained
@FreeTrained 3 месяца назад
I don't have much (good 😁) experience with react. However, I'll try to make this video soon.
@CliffShivkar
@CliffShivkar 6 дней назад
Amazing! Thank You so much. Could you please do the .Net Maui App that communicates with this api (sending & receiving data), crud operations where data is stored in sqlite on the phone
@FreeTrained
@FreeTrained 6 дней назад
I'll try it after some time.
@FebySamir
@FebySamir 3 месяца назад
I used JWT to make api .I made two roles Users and Employee so all data inserted in AspNetUsers table in database .i want to make a relationship between users with role User and another table called Bill and make relationship between users with role Employee with another table called Branch how i can do this by using Code First
@Sharondevbd
@Sharondevbd 28 дней назад
Brother your tutorial helps but, I Need Refresh Token Also. Can you please tell me how to implement that?
@creatortrainer9305
@creatortrainer9305 Месяц назад
hi dear I did the same as in your video but when I tried the GET method nothing happened! I am using windows 11 should I do something releated to my firewall?
@FreeTrained
@FreeTrained Месяц назад
Have You added HttpGet annotation?
@UmutDereWork
@UmutDereWork Месяц назад
An admin is also user. What about this :D
@FreeTrained
@FreeTrained Месяц назад
I just gave a demo. You can rename user to employee... 😂
@shabanelmogy7912
@shabanelmogy7912 3 месяца назад
please complete flutter tutorial with asp. net core api
@FreeTrained
@FreeTrained 3 месяца назад
It's already completed. Do you means using authentication and authorization?
@shabanelmogy7912
@shabanelmogy7912 3 месяца назад
@@FreeTrained yes
@shabanelmogy7912
@shabanelmogy7912 3 месяца назад
@@FreeTrained i want to know how using authentication in flutter and can i create authorizeview
@FreeTrained
@FreeTrained 3 месяца назад
Ok. Will be uploaded soon
@roopavarmatangella4248
@roopavarmatangella4248 Месяц назад
Please remove background noise. Its annoying.
Далее
Cute
00:16
Просмотров 6 млн
The Logging Everyone Should Be Using in .NET
15:34
Просмотров 65 тыс.
Cute
00:16
Просмотров 6 млн