Login API with JWT token Authentication in ASP .NET Core Minimal API Super Easy

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome guys to this interesting session of asp.net core 8.0 in this session we are going to implement JWT token authentication in our application web API and we are going to discuss how the 8.0 framework improved the identity and authentication guys I have already created few videos which JW token on web api. netcore 3.1 netcore 6 .0 and net course 7.0 I'll give the video link in the video description you can also check it out and after completing session I'm going to upload my source code to the Google Drive and going to give the link on video description so you can also download and check it out guys before starting the session I have a deep request to you you can see here in last 28 days 18.2k unique viewer are there and returning viewer are 3.8k so I have have a request to my unique viewer please do subscribe to my channel the subscription count encourage me a lot it will not cost you a single penny but you will not miss my future videos so today we are going to use visual studio and just few command guys before starting the session if you are new to my channel hit the Subscribe button and ring the bell icon for future notification and if you ended of liking my video give me a thumbs up and share this video with your friends let's get started so this is my practice folder I have created one folder net core of web API here I'm going to write my code okay to create application or to create upon the command Chrome you can write in the address bar command CMD you can see it is coming in my the current folder here I can write net new here I can write the web API so I need a web API with no https and enter so you can see it will create you can see right here it is creating the folder right next command we need to add the new get packages to need add new get packages the first one is Entity framework core SQL Server 8.0 preview next one is Entity framework core tools 8.0 preview again this is my third command next command is Entity framework code identity. Entity framework code H it okay next one is JWT toen be error or asp.net cor. authentication do JWT BR you can see our application got run completely sorry our application is install all the properties you can go to obj you can file all the new get here right now I will open this CS project in my visual studio Visual Studio 2022 guys please pay attention these are all our Command and lines only wait for a few second let it open next thing is I'm going to add my connection string in my app setting. first thing we did in command PR next thing is going to add inside our Command from so here you can see in my server Explorer I want to create a new connection to new to a new database so so you can see this is my server name and let's create one more server our connection this is connection SQL Server authentication user ID CSA password and here I I will create a new database so how I can create a new database let's say YouTube DB click on Advance is not creating we we will go and we will create there test connection so guys I I did manually created this DB YouTube DB in my SQL Server here I'm going to add my connections my user ID and password save my password Here database name is YouTube DB click on test connection connection succeed click on okay so this is my YouTu DV so here also initial catalog I'm going to change so in case you can see in YouTube DV there nothing is there if you see tables nothing is there now my task is go to create a app data context how I can create app data context now I'm going to create a class in my project app DV context and it will be inheriting from Identity DV context okay guys for the sake of timing I'm doing pest okay it required a using statement I think okay let's create a Constructor with option we created everything as it is till now Entity framework or next step is we need to go to our project double click on the project initial globalization make it false okay next we'll go to our program CS file here we need to add few line of code here I have added ATI endpoint identity user okay builder. service. identity API endpoint next builder. service. authentication next builder. service. MBC and next no need of this okay next is I'm adding my DP context which is my app DB contest this file completely and I'm taking the connection from default connection which is app setting do Json next line is we need to change in program. CS file before app. run okay how we can do like this map group SL identity identity identity user next is we need to go to our package manager console and need to add our Entity framework command the number seven and number eight command so here add hypen migration I'm giving initial DB so Bild started what wait for a few second it will create the migration file build succeed okay now we giving update Dash database in this here it will create my database table structure completely done I didn't do anything nothing it's created I just added now you can see go to database refresh the table here the magic right now run the application guys this will be interesting and for creating this kind of times take lots of actually upgrade the system to 8.0 preview it didn't work on directly UI so go went command proom so many things you can see all this API login register everything so go to the register you can see try it out I'm giving my email ID like B test.com I'm giving let's say YouTube 1 23 execute you can see the data also in the table also right so it's created so ACC right now so test.com and my password is youtube1 123 now go to the login section make it click on trite out cook is false s cook is false password is YouTube okay right now click on execute we will get our token yes done now go to table and we can see in the users you can find the record created also we want to refresh it refresh token already API endpoint is created refresh token API you can see and just minimize it here here here refresh just give the refresh token again you will generate our BR token again right in this way we can create a net core8 8.0 JWT talker authentication guys I hope you like this session if you do give me a like and share this video with your friends thank you very much
Info
Channel: Biswa Ranjan
Views: 541
Rating: undefined out of 5
Keywords: JWT, .Net Core Authentication, .Net Core 8.0, .Net Core 8.0 JWT Token, .Net Core 8.0 JWT Token Authentication, .Net Core, .Net Core JWT Token, .Net Core JWT Token Authentication, Dot Net Core 8.0, Dot Net Core 8.0 JWT Token, Dot Net Core 6.0 JWT Token Authentication, .Net Core 6.0 Web API, .Net Core 6.0 Web API JWT Token, .Net Core 8.0 Web API JWT Token Authentication, Dot Net Core 6.0 Web API, Dot Net Core 6.0 Web API JWT Token, Dot Net Core 8.0 Web API JWT Token Authentication
Id: HcEL46GLwjI
Channel Id: undefined
Length: 10min 44sec (644 seconds)
Published: Mon Nov 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.