Code Overdose
Code Overdose
  • 6
  • 14 481
.NET 8 Refresh Token using JWT in Blazor + Web API
In this project, I will use Blazor Web App frontend + Web API backend in .NET 8, using Entity Framework Core code first, database using SQL Server.
In this Part 4, I will show you how to implement Refresh Token using Json Web Token (JWT)
00:00 Create Refresh Token
02:41 Handle Token Expiry
09:36 Save Refresh Token
13:44 Verify User Info
19:01 Test Refresh Token
Link play list for CRUD Blazor Web App & Web API in REAL project:
ua-cam.com/play/PLNn06NGB6PTgymNp3PbptkeZYG5jZCAwK.html
Link to Part 1:
ua-cam.com/video/t1mQOWsFpzM/v-deo.html
Link to Part 2:
ua-cam.com/video/bJD5prxWiFc/v-deo.html
Link to Part 3:
ua-cam.com/video/oqpNQxEfz_Y/v-deo.html
Link download source code : github.com/hieudose/BlazorApp
Create by: Dose Hieu
#DotNet #Blazor #AspNetCore #authentication #authorization #jwt #aspnetcore #webapi #csharp #aspnet #dotnet8 #refreshtoken
Переглядів: 1 020

Відео

Difference between ToList() and ToListAsync()
Переглядів 33314 днів тому
In this video, we’re diving into asynchronous programming with async await keywords and exploring the differences between ToList and ToListAsync. 00:00 Introduction 02:03 Difference Between ToList and ToListAsync 03:45 Demo: ToList vs. ToListAsync 06:50 Performance Improvement Link play list for CRUD Blazor Web App & Web API in REAL project: ua-cam.com/play/PLNn06NGB6PTgymNp3PbptkeZYG5jZCAwK.ht...
.NET 8 Role-Based Authorization with JSON Web Tokens (JWT) in Blazor + Web API
Переглядів 2,1 тис.21 день тому
In this project, I will use Blazor Web App frontend Web API backend in .NET 8, using Entity Framework Core code first, database using SQL Server. In Part 3, I will show you how to implement Role-Based Authentication and Authorization using JWT 00:00 Intro and flow explanation 01:27 Create Login API 04:40 Setup JWT validation 08:26 Build login form 10:32 Implement AuthenticationStateProvider 14:...
CRUD Blazor Web App & Web API in a Real Project (.NET 8) - Part 2 CRUD operations
Переглядів 1,5 тис.Місяць тому
In this project, I will use Blazor Web App frontend Web API backend in .NET 8, using Entity Framework Core code first, database using SQL Server. 00:00 Create Function 03:00 Install Toast Message 07:30 Update Function 13:00 Modal Component 14:00 Delete Function Link play list for CRUD Blazor Web App & Web API in REAL project: ua-cam.com/play/PLNn06NGB6PTgymNp3PbptkeZYG5jZCAwK.html Link to Part ...
Microservices with Kafka: ECommerce Example (.NET 8)
Переглядів 4,4 тис.Місяць тому
In this project, I will create a sample e-commerce app using .NET 8. The frontend will be built with Blazor Web App, and the backend services will be developed using Web API. Entity Framework Core with a code-first approach will be used for database interactions, with SQL Server as the database. Additionally, two services will use Kafka as a message broker to send and receive messages 0:00 Intr...
Blazor Web App & Web API in REAL project (.NET 8) - Part 1
Переглядів 5 тис.2 місяці тому
In this project, I will use Blazor Web App frontend Web API backend in .NET 8, using Entity Framework Core code first, database using SQL Server. 00:00 Introduce, Create project 02:40 Service-oriented architecture (SOA) 04:00 Implement SOA 09:39 Entity Framework Core 14:42 Create Controller 16:58 Create Service 18:16 Create Repository 20:38 Create Blazor frontend Link play list for CRUD Blazor ...

КОМЕНТАРІ

  • @2005Azm
    @2005Azm 3 дні тому

    This is fantastic!

    • @dosehieu
      @dosehieu 3 дні тому

      @@2005Azm Thank you 🥰

  • @justvuu
    @justvuu 4 дні тому

    Nice!

    • @dosehieu
      @dosehieu 3 дні тому

      @@justvuu Thank you so much🥰

  • @CentauriDK
    @CentauriDK 9 днів тому

    Thanks for your greate futorial. Just what I was looking for to continue learning Blazor. But shouldn't their be an error message when you login with an wrong username and password?

    • @dosehieu
      @dosehieu 9 днів тому

      Hi @CentauriDK. You're right. In a real project, we need to handle user login failures, and the password should be encrypted before being saved to the database. I may handle this in the next video. Thanks for your question!

  • @Guitariste82
    @Guitariste82 10 днів тому

    Very good!!! You deserve more subscribers considering the quality of your content. Can you update your Github with this part .... if possible 🙂 .

    • @dosehieu
      @dosehieu 10 днів тому

      Oh I forgot about that. Thanks for reminding 🥰🥰

    • @Guitariste82
      @Guitariste82 10 днів тому

      @@dosehieu Ty for the update !

    • @dosehieu
      @dosehieu 10 днів тому

      @@Guitariste82 You're very welcome🥰

  • @pankajsharma-yw3rl
    @pankajsharma-yw3rl 10 днів тому

    Thanks 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

    • @dosehieu
      @dosehieu 10 днів тому

      @@pankajsharma-yw3rl You're welcome 🥰🥰

  • @GarethDoherty1985
    @GarethDoherty1985 11 днів тому

    Loving these tutorials

    • @dosehieu
      @dosehieu 10 днів тому

      @@GarethDoherty1985 Thanks for your support 🥰🥰

  • @DragoGrayLite
    @DragoGrayLite 11 днів тому

    Incredible 🤓

    • @dosehieu
      @dosehieu 11 днів тому

      @@DragoGrayLite Thank you so much🥰🥰

  • @tavara7279
    @tavara7279 13 днів тому

    What's user and Password?

    • @dosehieu
      @dosehieu 13 днів тому

      Hi @tavara7279, I haven't implemented authentication in this part. If you want to see authentication and role-based authorization, please check my Part 3 video here: ua-cam.com/video/oqpNQxEfz_Y/v-deo.html

  • @kha88kha88
    @kha88kha88 15 днів тому

    It would be great channel ❤

    • @dosehieu
      @dosehieu 15 днів тому

      @@kha88kha88 Thanks for your kind words. 🥰🥰

  • @luizfredericojr
    @luizfredericojr 15 днів тому

    Very good course. The layers make sense. The code is clean. Some tables like user and claims are missing, don't you think? I just don't understand why not use Identity? Even if it was just to create the tables... But anyway, your content is very good and well explained, thank you.🕶😀 Continue this series👍

    • @dosehieu
      @dosehieu 15 днів тому

      @@luizfredericojr Thanks for your kind words. Good question! For simplicity, I'm not implementing user verification in this video. I plan to implement user verification using Identity and add refresh tokens in the next video 😊😊

  • @oktjona
    @oktjona 16 днів тому

    you are perfect

    • @dosehieu
      @dosehieu 16 днів тому

      @@oktjona Thank you very much. 🥰🥰

    • @oktjona
      @oktjona 16 днів тому

      @@dosehieu what about creation of account by registering ,you showed only login

  • @CentauriDK
    @CentauriDK 16 днів тому

    Thanks for the greate tutorial. Its exatly what I am currently working with. Cant wait for the next part Hope you also include that the users login are saved in the database for a real world example.

    • @dosehieu
      @dosehieu 16 днів тому

      @@CentauriDK Thanks for your support. I will publish more about this very soon. 😍😍

  • @garamburito
    @garamburito 16 днів тому

    Hi, thanks for the video, how do you get the console admin page that appears a the beginning ?

    • @dosehieu
      @dosehieu 16 днів тому

      @@garamburito Hi. Thank you for watching. Do you mean .NET Aspire? That is a lightweight framework designed to help developers get started with .NET Core in a more streamlined way, focusing on rapid development and deployment. It offers a simplified setup, essential tools, and features that are especially useful for building modern web applications with minimal overhead

    • @garamburito
      @garamburito 16 днів тому

      @@dosehieu thanks a lot for the info.

  • @germanjesus214
    @germanjesus214 16 днів тому

    Muchas gracias por el video, desde hace tiempo que quería saber cómo hacer una aplicación fullstack, solo he estudiado el desarrollo de API, no he tocado front para nada, tu video me sirvio mucho, gracias. saludos desde Colombia.

    • @dosehieu
      @dosehieu 16 днів тому

      @@germanjesus214 Welcome! Colombia is a great country. I'm very happy to hear that you find it helpful.😊😊

  • @MohammadKomaei
    @MohammadKomaei 17 днів тому

    Repository is implemented in ef core dbcontext class so creating the repository classes is anti pattern and caused complexity and decreasing performance.

    • @dosehieu
      @dosehieu 16 днів тому

      @@MohammadKomaei Hi. EF Core does not implement the repository pattern out of the box. EF Core provides a DbContext for data access, but it doesn’t include a repository layer. The repository pattern can be implemented on top of EF Core if desired, but it is not a built-in feature.😊😊

  • @phaminhthien7772
    @phaminhthien7772 17 днів тому

    It’s so great, keep it up man 💪

    • @dosehieu
      @dosehieu 17 днів тому

      @@phaminhthien7772 Thanks for your kind words Thien. I'm still following your articles on Viblo. Looking for your next articles.😍😍

  • @minhvu5239
    @minhvu5239 17 днів тому

    Send to you my respect, from former colleague at MISA❤

    • @dosehieu
      @dosehieu 17 днів тому

      @@minhvu5239 Thank you for supporting Minh. Very glad to see you here🥰🥰

    • @minhvu5239
      @minhvu5239 17 днів тому

      @@dosehieuI hope you'll release more videos about messeage broker in more detail. I really look forward to it 🤗❤

    • @dosehieu
      @dosehieu 17 днів тому

      @@minhvu5239 Sure. I will publish more about this very soon. 😊😊

  • @arunbastin2990
    @arunbastin2990 18 днів тому

    Good explanation.Continue this series❤

    • @dosehieu
      @dosehieu 18 днів тому

      Thank you! I will do😊😊

  • @asesorwebvideos
    @asesorwebvideos 19 днів тому

    Gracias, saludos desde Chile

    • @dosehieu
      @dosehieu 18 днів тому

      Welcome, Chile is nice country🥰🥰

  • @pankajsharma-yw3rl
    @pankajsharma-yw3rl 20 днів тому

    your videos are great & self explained. it would be highly appreciated if you please give next video on refresh token & cascading master tables & pdf excel export on that same project

    • @dosehieu
      @dosehieu 19 днів тому

      Thank you. I will publish it soon 😊😊

  • @EldonElledge
    @EldonElledge 22 дні тому

    This is an excellent simple demo that can teach so much in such a little time. Great job Dose.

    • @dosehieu
      @dosehieu 21 день тому

      Thank you. I will publish more exciting content in the future. 😊😊

  • @cissemy
    @cissemy 22 дні тому

    Great video. Can you make a video about how to deploy it using docker ?

    • @dosehieu
      @dosehieu 22 дні тому

      Thank you. I will make it soon ☺☺

  • @ToniTodorov-g8z
    @ToniTodorov-g8z 23 дні тому

    In my opinion, this is a very useful course. For those new to BlazorApp (like me). I have one question: in your opinion for "medium volume applications" which "application architecture" is better: "Clean Architecture" or "Modular Monolith"?

    • @dosehieu
      @dosehieu 22 дні тому

      Thank you for your kind words! As for your question, both Microservice Architecture and Modular Monolith have their advantages, and the choice depends on your specific needs. For a medium-volume application, Modular Monolith might be more practical if you're aiming for simplicity and faster development. However, if you anticipate needing to scale or add complexity in the future, Microservice Architecture might be a better long-term choice ☺☺

    • @ToniTodorov-g8z
      @ToniTodorov-g8z 22 дні тому

      @@dosehieu Thanks for the reply. One additional question. In this project, are you thinking of developing some "architecture"? Or it will be just one "monolithic application", which for "one example" is actually quite enough.

    • @dosehieu
      @dosehieu 21 день тому

      Hi @@ToniTodorov-g8z, In this project, I’m leaning towards a Modular Monolith approach for simplicity, as an example 😊 If you want to learn more about the Architecture, check out my video on Microservice Architecture here. ua-cam.com/video/CbDgOlqBvrs/v-deo.html

  • @vietnguyen2521
    @vietnguyen2521 23 дні тому

    Perfectly tutorial for beginer, thank you. Hope you will be make more video about microservices in dotnet 8 and aspire

    • @dosehieu
      @dosehieu 23 дні тому

      I'm glad you found the tutorial helpful. Thank you☺☺

  • @JoeChiu-i8n
    @JoeChiu-i8n 25 днів тому

    it's really awesome, really Clearly, and very useful

    • @dosehieu
      @dosehieu 25 днів тому

      Thank you so much 😍😍

  • @lukevincent4397
    @lukevincent4397 27 днів тому

    Your screen text is way too small and you have uploaded the video in 720p - useless.

    • @dosehieu
      @dosehieu 27 днів тому

      Hi @lukevincent4397, sorry about the inconvenience. This is my first video. In the next video, I will change the font size and improve the image quality. Thank you for letting me know 😊😊

  • @osamaayesh9495
    @osamaayesh9495 28 днів тому

    hey which way u did to connect to sql server seems u in sql server have migration history

    • @dosehieu
      @dosehieu 27 днів тому

      Hi @osamaayesh9495, you can use either the Code First approach or the DB First approach. However, in real projects, we often avoid using them because we want to apply our own naming conventions. For example, if you have a new table named Order, just go to the database and create the Order table. Then, create a model class named OrderModel.cs and declare the DbSet for it in the DbContext. When you run the app, it will automatically connect them😊😊

    • @osamaayesh9495
      @osamaayesh9495 27 днів тому

      @@dosehieu okey thanks but so if i follow ur step in this video with avoiding code first and data base i will automatically connect to sql server ? cuz u in this video didn't create database and table product so i must creat them then follow ur steps ?

    • @dosehieu
      @dosehieu 27 днів тому

      Hi @osamaayesh9495, you don't need to create the database beforehand. As you can see in the DbContext, I have this Database.EnsureCreated();. The first time you run the app, if the database doesn't exist, Entity Framework will automatically create it. 😊

    • @osamaayesh9495
      @osamaayesh9495 26 днів тому

      @@dosehieu hey how i can edit or delete a column from sql server or just from model ?

    • @dosehieu
      @dosehieu 26 днів тому

      Hi @@osamaayesh9495 If you need to change anything, let's update both the database and the model. It will automatically connect. For example, if I want to add a column 'Discount' to the 'Product' table, just go to the database and create that column, then go to the Product model and add the 'Discount' property ☺

  • @netrunner1987
    @netrunner1987 28 днів тому

    at 2:10, I'm getting a few errors: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type Argument 2: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback<int>' to 'Microsoft.AspNetCore.Components.EventCallback' Cannot implicitly convert type 'int' to 'string' Then it repeats most again. This is from your github and just adding the beginner parts.

    • @dosehieu
      @dosehieu 28 днів тому

      Hi @netrunner1987, ensure that at 2:10, you just add a submit button, then set OnValidSubmit to the Submit function. Can you see where your error shows? In which file and on what line?

  • @nedas6235
    @nedas6235 29 днів тому

    Great tutorial, however, I'm having issues at 22:25. My create order button does not do anything (no browser alert, no posting new orders). I'm assuming the @onclick method is not triggering for me at all, has anyone encountered anything like this? Posting new orders works fine on swagger ui.

    • @dosehieu
      @dosehieu 28 днів тому

      Hi @nedas6235, in the CreateOrder function, make sure to copy the correct Order address in OrderService => LaunchSettings.json. If you're still stuck, send me your repository link, and I'll take a look. 😊😊

    • @nedas6235
      @nedas6235 28 днів тому

      @@dosehieu Hey, I managed to figure it out, I added <Routes @rendermode="InteractiveServer" /> to my app.razor file, which fixed the issue. Now the button works as intended 🙂

    • @dosehieu
      @dosehieu 28 днів тому

      @@nedas6235 That was great! 😊😊

    • @althafahmed2415
      @althafahmed2415 4 дні тому

      @@nedas6235 Thanks

  • @jsiahaan
    @jsiahaan Місяць тому

    Thank you so much, I'm going to continue the second part soon!

    • @dosehieu
      @dosehieu Місяць тому

      Thank you🥰🥰

  • @satwikgawas5582
    @satwikgawas5582 Місяць тому

    Hello sir waiting for authentication and authorization in blazor using jwt

    • @dosehieu
      @dosehieu Місяць тому

      Of course! I will publish it very soon 😊😊

  • @jsiahaan
    @jsiahaan Місяць тому

    Very simple, clear, and, easy to understand. Waiting for new coming videos!

    • @dosehieu
      @dosehieu Місяць тому

      Thank you so much ☺☺

  • @QaisarArsalan
    @QaisarArsalan Місяць тому

    where is migration class and where i can apply ?

    • @dosehieu
      @dosehieu Місяць тому

      Hi @QaisarArsalan, I didn't use Code First in this example. If you need to make any changes to the database, first update your table, then update the model class for that table. They just need to map to each other. Migration is not required ☺☺

  • @muhammadasaad1314
    @muhammadasaad1314 Місяць тому

    i have to APPLY AUTHORIZATION ON THE ACTIONS OF PRODUCT HOW TO DO IT?

    • @dosehieu
      @dosehieu Місяць тому

      I will have another video on Authentication and Authorization in a Blazor Web App using JWT tokens soon. Follow me to get it as soon as it's ready☺☺

    • @maurosanz6125
      @maurosanz6125 Місяць тому

      @@dosehieu yes please 📿

  • @nguyenhieu-c2q
    @nguyenhieu-c2q Місяць тому

    can you make more videos like this

    • @dosehieu
      @dosehieu Місяць тому

      Of course! Thank you

  • @nguyenhieu-c2q
    @nguyenhieu-c2q Місяць тому

    can you make more videos like this

    • @dosehieu
      @dosehieu Місяць тому

      Of course! Thank you

  • @RupeshMahale-
    @RupeshMahale- Місяць тому

    I would like to know kafka auth with SASL/GSSAPI. Could you please make a video for that?

    • @dosehieu
      @dosehieu Місяць тому

      Of course! I will make it soon 👍👍🥰

  • @StarlakeKT
    @StarlakeKT Місяць тому

    Bạn có thể làm thêm nhiều video như thế này được không?

    • @dosehieu
      @dosehieu Місяць тому

      Of course! Thank you🥰

  • @trangphan8278
    @trangphan8278 Місяць тому

    Hay quá

    • @dosehieu
      @dosehieu Місяць тому

      Thank you 🥰

  • @hnieeffadzli1183
    @hnieeffadzli1183 2 місяці тому

    can u do sample with microservice architecture

    • @dosehieu
      @dosehieu 2 місяці тому

      Sure. I will make it soon 😉

    • @hnieeffadzli1183
      @hnieeffadzli1183 2 місяці тому

      @@dosehieu yehaaa cant wait to see

    • @kmuhanad45
      @kmuhanad45 2 місяці тому

      Thanks

    • @dosehieu
      @dosehieu Місяць тому

      I just published a new video about this. You can watch it now! 🥰

  • @trangphan8278
    @trangphan8278 2 місяці тому