It is easy to miss because Patrick goes by it so quick @23:00 Visual Studio tries to get you to do System.IdentityModel.Tokens but you need Microsoft.IdentityModel.Tokens as he says but its so quick blink and you miss it and might get stuck. Just thought I would leave this comment for anyone else who is confused why their code isn't working. Thanks Patrick for such a great tutorial!
I have been putting off working on my term paper for about a month because I could not even understand the topic, but thanks to you everything became clear. Thanks dude and greetings from Ukraine :3
Nice tutorial In order for jwt token to be practical, you will need to provide a refresh token. Otherwise you will have to login every time you refresh a page.
Bit pedantic but in a production system I would not return "Bad Username" and "Bad Password" as a bad actor can use that information for their gain. Great tutorial as always 🙂
Great video, clear, fast and concise. One tip though, since you are using a lot of key strokes when creating the methods, you could save some time when you get to entering the curly braces at the end of the method name, ({}), by simply enter the opening curly brace { and then hit Enter. It will close the curly brace, format them on the next line and put the cursor between the two ready to continue coding. No fiddling with the arrow keys to get back to the correct position. Keep up the good work.
Hello Pattrick, would love to ask if you have a course on yt or udemy solely about EF Core (i.e. regarding 1:1, 1:n, n:n Relationships and how to work well with Fluent API)? If not, would love to request on that idea, Thank you!
Hey there, Thanks for your feedback and suggestion. We actually cover all types of relationships in the. NET Jumpstart course with EF Core and SQL Server. But this is also a great idea for a quick and dirty tutorial. So, stay tuned. 😉
I noticed when I create a new Blazor WebAssembly app with "Individual Accounts", the AspNetUser entity doesn't have a "Password Salt" field. I know it used to, I'm just wondering why it no longer does?
Thank you so much for this excellent tutorial, Patrick. I also have a toddler, so, I know what you mean when it comes to struggling to sleep. Go well and stay healthy man. These are crazy times.
It was a great video Patrick, but really very demanding. Still thanks again for the preview, I like your videos! I sent link to your videos to my friends
Olá, meu nome é Eduardo Henrique, moro no Brasil, foi um prazer enorme participar deste treinamento, gostei muito e quero aproveitar outros vídeos, Vindo passear no Brasil, está convidado a ficar em minha casa, moro próximo da capital de Minas Gerais, em uma cidade chamada Santa Luzia. Fique com Deus. "Hello, my name is Eduardo Henrique, I live in Brazil, it was a great pleasure to participate in this training, I really enjoyed it and I want to enjoy other videos, Coming for a walk in Brazil, you are invited to stay at my house, I live close to the capital of Minas Gerais, in a town called Santa Luzia. God be with you."
hi patrick, if you leave the passwortSalt in the userdto as property, a hacker gets the salt to test from the api at 13:16. and if you have the user as static in line 16, then it will interact with other logins at the same time. right? but i love your tutorial
Thanks Patrick, just had a couple different questions: 1. Is this how it's really done in production? I've seen a lot of tutorials almost all of which refer to the Identity package and external IdP but if your app (i.e. your DB) is the IdP in and of itself is this how it's done? 2. I can't help but strain my eyes seeing that static User instance in your controller, not sure how this would even work as concurrent users would more than likely mutate the same instance ... how would you go about getting a user in the method body i.e. via transient service or http context? 3. What's a good way to deal with 3rd party integrations? I still want to use this methodology to sign in users to my application but I want them to be able to add other social integrations in app to query remote resources. Would I have a table with FK to user, token, and refresh token allowing me to refresh as needed?
Very helpful video. I have a queation. During the ligin method testing. after you giving string as user name it says " CRAZY TOKEN" so where is it validating the user name i mean there i no database right?
Hi! thanks for the video, amazing as always, I have a question, why you put "= string.Empty()" in a property? I know that is for changing the default value of a string, wich is null, to an empty string, but why ?
▶ [Part 2/4] .NET 6 Web API 🔒 Role-Based Authorization with JSON Web Tokens (JWT): th-cam.com/video/TDY_DtTEkes/w-d-xo.html ▶ [Part 3/4] .NET 6 Web API 🔒 Read JWT Authorization Claims of a User (from a JSON Web Token): th-cam.com/video/fhWIkbF18lM/w-d-xo.html ▶ [Part 4/4] Refresh Tokens with a .NET 6 Web API 🚀: th-cam.com/video/HGIdAn2h8BA/w-d-xo.html
Hi Patrick, Thank you for this tutorials very useful., My concern now is how to Post to the database if you register and to Get the user from the database? Thank you in advance...
Hello Patrick, love your videos! Im completely new to this and would like to learn how to store registered users in a sql database. You dont happen to have any videos that demonstrates the entire process?
Hi Professor Now that we have received the token after logging into the system, how is this token used in the user's activities on the site. Do you have training in this field?
Hi, great tutorial, thakns. Is ther a way to use this technic with a web application? Fo now I use cookies, it works fine, but I will have to manage SSO possibly with cross domain, and cookies does't travels from one domain to another, so I search how to use jwt cookieless on a webb app, not API.
Thank You Patrick! If I want an web app to authenticate against this API, where should I store the Token, in a cookie, in session? What's your sugestion? So the API login method should take care of this? Thanks again.
I am trying this approach with SqL server. I am unable to save the PasswordHash and PasswordSalt to DB. I am receiving serialization and deserialization of 'system.action' error. Couldn't find solution for this online as well.
man i thought it's only me having "refresh trouble" after compiling using visual studio 2022 😂, it's better get rest immediately right after encountering this "refresh trouble"
i literally clapping my hands when i finished watching the tutorial. good job! one questions, would you advise to use customized authentication or use UserIdentity?
Hey Patrick, Thanks for awesome video . do you have any video about how to save the user in Db and not on a static like now ? (User user = new User right now) ...
15:41 Can you explain why the login method works ? You're sending the values "string" while in your code the user's username and password are both set to Empty ... In my opinion this should have not worked with either "string" or "string1" ... I'm a bit confused
Thank you for not speaking as slow as humanly possible. I always have to put programming tutorials on 2x speed, but this was perfect.
It is easy to miss because Patrick goes by it so quick @23:00
Visual Studio tries to get you to do System.IdentityModel.Tokens but you need Microsoft.IdentityModel.Tokens as he says but its so quick blink and you miss it and might get stuck. Just thought I would leave this comment for anyone else who is confused why their code isn't working. Thanks Patrick for such a great tutorial!
IM so glad someone is making JWT with .NET 6. Other people make videos with .NET 2 in 2022 which doesn't make any sense.
Glad I could help! Thanks for your feedback!
I stucked with JWT for one month but thanks to you I solved it finally. THANK YOU SO MUCH
Great to hear! Thanks for your feedback!
same here
I have been putting off working on my term paper for about a month because I could not even understand the topic, but thanks to you everything became clear. Thanks dude and greetings from Ukraine :3
Glad I could help! 😊Thanks a lot for your feedback!
I saw this twice. the way you have explained, its very very easy and understandable.
Thank you so much.
I don't have any requests but just wanted to pass along another thank you as your videos are very instructive, concise and helpful.
Thank you so much!! Means a lot. 😊
It's art to able to share knowledge as easy as you doing.
Thank you so much! 😊
Nice tutorial
In order for jwt token to be practical, you will need to provide a refresh token. Otherwise you will have to login every time you refresh a page.
Hi, may I ask the logic of a logout API in respect of JWT authentication and authorization. It seems like ur quite knowledgeable in this topic!
its perfect to watch the video.The video timeline can see your implementation funtion.
Hello from Argentina Patrick!! Only i want you to know that you are a very good teacher, with very clearly explanations. I wish you a lot of success!
Thank you so much! Means a lot to me! 😊
Wow i was looking for exactly this, and presented by no other than the cozyest guy out there. cheers
This is great. Thank you so much for your kind feedback. 😀
Bit pedantic but in a production system I would not return "Bad Username" and "Bad Password" as a bad actor can use that information for their gain. Great tutorial as always 🙂
I agree, keep them guessing
You are absolutely right, Andrew! Thanks for sharing. 😊
"I would never use the Lord's name in vain. Why would you think that?" 😂😂😂😂
Subbed!!!!
Thank you!! 😁
Great video, clear, fast and concise. One tip though, since you are using a lot of key strokes when creating the methods, you could save some time when you get to entering the curly braces at the end of the method name, ({}), by simply enter the opening curly brace { and then hit Enter. It will close the curly brace, format them on the next line and put the cursor between the two ready to continue coding. No fiddling with the arrow keys to get back to the correct position. Keep up the good work.
Dude! All these years! Thank you so much, this is amazing! 😄
Thank you Patrick! I love the intro and how this community reacts on your last name 😂😂😂
Hello Pattrick, would love to ask if you have a course on yt or udemy solely about EF Core (i.e. regarding 1:1, 1:n, n:n Relationships and how to work well with Fluent API)? If not, would love to request on that idea, Thank you!
Hey there, Thanks for your feedback and suggestion. We actually cover all types of relationships in the. NET Jumpstart course with EF Core and SQL Server. But this is also a great idea for a quick and dirty tutorial. So, stay tuned. 😉
@@PatrickGod Thank God for hearing our prayers and thank you Patrick for helping us to learn a fun and much easier with the tutorials and knowledge! ✨
@@donmikkodanm.olmillo8154 Glad I can help. 😉
I noticed when I create a new Blazor WebAssembly app with "Individual Accounts", the AspNetUser entity doesn't have a "Password Salt" field. I know it used to, I'm just wondering why it no longer does?
Finally, the last name, been so afraid to say it. Very helpful tutorial, keep up the good job
😊 Glad it helped! Thanks for your feedback!
Thanks for video tutorial. The best part is that it is short and straight to the point.
Thank you so much! Glad you like it! 😊
Love your humor man! keep it going with you easy to learn videos
Thank you so much! Appreciate it.😊
This video is pretty old, but still very helpful. Thank you sir!
Thanks Patrick, you tutorial helped me a lot. Much appreciated.
You're most welcome! Thank YOU so much!! Really appreciate it! 😊
Thank you so much for this excellent tutorial, Patrick. I also have a toddler, so, I know what you mean when it comes to struggling to sleep. Go well and stay healthy man. These are crazy times.
They are, indeed. Thanks for your feedback. More sleep would be really great. 😅
This guy's a gamer. Tries to type "user" but left hand goes to wasd and types "uawe" instead.
😂
Vielen Dank für das Video, es hat sehr viel Spaß gemacht es nach zu programmieren 🙂
Freut mich sehr! Danke für dein Feedback - und den Kaffee! 😁
Bro, you just deserve this last name hahahah, thank you so much !
😂 Thank you!
Great tutorial, deserves a comment for sure!
Much appreciated!
thanks, you save my final exam! with createToken function xD!
Hey, Patrick, you made authentication very easy and teach use in very simpler way.
Thanks for amazing tutorial.
Hi Patrick, your tutorials are great. Can you make a tutorial for CustomAuthorization(ApiKey and JWT)? :)
Just got your course at Udemy.
Thank you for the tutorials. I hope you dont have to deal with to many people who harass Gods.
Thanks God. This video is really helpful for me.
Glad it was helpful!
How would you connect this entire series of jwt authentication and oauth2 with angular on the frontend?
It was a great video Patrick, but really very demanding. Still thanks again for the preview, I like your videos! I sent link to your videos to my friends
Awesome, thank you! 😄
Please keep posting on you tube they are so amazing great job
Olá, meu nome é Eduardo Henrique, moro no Brasil, foi um prazer enorme participar deste treinamento, gostei muito e quero aproveitar outros vídeos, Vindo passear no Brasil, está convidado a ficar em minha casa, moro próximo da capital de Minas Gerais, em uma cidade chamada Santa Luzia. Fique com Deus.
"Hello, my name is Eduardo Henrique, I live in Brazil, it was a great pleasure to participate in this training, I really enjoyed it and I want to enjoy other videos, Coming for a walk in Brazil, you are invited to stay at my house, I live close to the capital of Minas Gerais, in a town called Santa Luzia. God be with you."
Superb! Continue this video with authentication and refresh token. And use it in some tasks. Greate
Thanks God! :) Very clear and perfect pace...
Thank you so much! 😊
How do you persist the registered user data for later login?
ein sehr hilfreiches video, vielen dank!
hi patrick, if you leave the passwortSalt in the userdto as property, a hacker gets the salt to test from the api at 13:16.
and if you have the user as static in line 16, then it will interact with other logins at the same time.
right?
but i love your tutorial
Thanks Patrick, just had a couple different questions:
1. Is this how it's really done in production? I've seen a lot of tutorials almost all of which refer to the Identity package and external IdP but if your app (i.e. your DB) is the IdP in and of itself is this how it's done?
2. I can't help but strain my eyes seeing that static User instance in your controller, not sure how this would even work as concurrent users would more than likely mutate the same instance ... how would you go about getting a user in the method body i.e. via transient service or http context?
3. What's a good way to deal with 3rd party integrations? I still want to use this methodology to sign in users to my application but I want them to be able to add other social integrations in app to query remote resources. Would I have a table with FK to user, token, and refresh token allowing me to refresh as needed?
Anyone's answer on this will be appreciated
Great video...really helpful. Thanks man
Wait does the out keyword create variables? In the register method you didn't initialize passwordHash and passwordSalt???
Are you retrieving data from database also in login method?
Very helpful video. I have a queation. During the ligin method testing. after you giving string as user name it says " CRAZY TOKEN" so where is it validating the user name i mean there i no database right?
Thank you saved my project , you're the best ❤
Glad I could help! Thanks a lot for your feedback! 😊
is there a video about configuring this with a database?
how about using this webapi and consume in a core application with admin panel ?
hey Patrick, can you make a video about the use of Interface?
Hi! thanks for the video, amazing as always, I have a question, why you put "= string.Empty()" in a property? I know that is for changing the default value of a string, wich is null, to an empty string, but why ?
Initially thank you
I love you man. Thanks so much for this tutorial and the pagination one.
Happy to help! Thank you very much for your feedback! 😊
What a godly content. Thank you
Thank YOU!
I don't know how to thank you man! Thank you very much...
sir this "System.Text.Encoding.Utf8.getbytes()" function are not avalable in this package
▶ [Part 2/4] .NET 6 Web API 🔒 Role-Based Authorization with JSON Web Tokens (JWT): th-cam.com/video/TDY_DtTEkes/w-d-xo.html
▶ [Part 3/4] .NET 6 Web API 🔒 Read JWT Authorization Claims of a User (from a JSON Web Token): th-cam.com/video/fhWIkbF18lM/w-d-xo.html
▶ [Part 4/4] Refresh Tokens with a .NET 6 Web API 🚀: th-cam.com/video/HGIdAn2h8BA/w-d-xo.html
Hi Patrick, Thank you for this tutorials very useful., My concern now is how to Post to the database if you register and to Get the user from the database? Thank you in advance...
why is your access modifier for username set public?
Thanks for this valuable tutorial, learning alot fro this channel
is there a reason why you labled the user object as static?
thank you sir.. but how can i implement this JWT token on the client side? have you made a video about it?
This one is for you: th-cam.com/video/Yh16E2u2pio/w-d-xo.htmlsi=GHlDOTnINjLHTnwa
@@PatrickGod thank you again sir.. is it the same for web App empty? Or should i use blazor?
Thanks for the video, greetings from Brazil.
Thank you for the tutorials
My pleasure!
Thank God. Thank you God
Hi Patrick, great course !!! Thx
Thank you for making perfect video. I have a question how about logout. Can you make a video or suggest me some solutions. Thanks
Hello Patrick, love your videos! Im completely new to this and would like to learn how to store registered users in a sql database.
You dont happen to have any videos that demonstrates the entire process?
Hey there! We do that in the .NET 6 Jump Start Course. You can check it out here: th-cam.com/video/K23uJdMiEpk/w-d-xo.html
Hi Patrick, thanks for the tutorial and my free course .NET Core teacher. Your explanation is very clear and easy to understand 👍👍
Why does the repo suddenly has userservices and Iuserservices?
Nice Tutorial , its simple and easy to grasps.
I dont understand why your key is "top secret key" and everything works fine while mine key must be long af, otherwise i receive errors about key
Yeah same here, I received error if my key gets less than 512 bits so my secret key is long af
Why are you returning your Model from the controller?
Hi Professor
Now that we have received the token after logging into the system, how is this token used in the user's activities on the site. Do you have training in this field?
how do we use expire time in token to logout application automatically after certain time in angular?
Hi, great tutorial, thakns. Is ther a way to use this technic with a web application? Fo now I use cookies, it works fine, but I will have to manage SSO possibly with cross domain, and cookies does't travels from one domain to another, so I search how to use jwt cookieless on a webb app, not API.
i love u mr Patrick. Thanks for everything
Hello sir, first of all thank you for your video. I have a question. How can i save user information in database ?
Hi can you list what are the nugget packages with version you have used in this tutorial
Thank You Patrick! If I want an web app to authenticate against this API, where should I store the Token, in a cookie, in session? What's your sugestion? So the API login method should take care of this? Thanks again.
I am trying this approach with SqL server. I am unable to save the PasswordHash and PasswordSalt to DB. I am receiving serialization and deserialization of 'system.action' error. Couldn't find solution for this online as well.
Great tutorial! I was exactly looking for that and it’s very well explained :)
Thank you very much for your feedback! 😊
i want to use auth plugin , vue frontend, .net core , mssql for backend, Can you suggest please.
This is good quality material. Thank you so much.
Thank you very much for your feedback! Glad I could help. 🙂
man i thought it's only me having "refresh trouble" after compiling using visual studio 2022 😂, it's better get rest immediately right after encountering this "refresh trouble"
Exactly what I was looking for, Thanks
and now. How i use it in a API?
I want only authorized users get the list of products
I like and subscribed. Thank you
Thank you so much!
i literally clapping my hands when i finished watching the tutorial. good job! one questions, would you advise to use customized authentication or use UserIdentity?
Your videos are the most helpful ive found, thank you !!!
Tried it in .net 5 and upon checking jwt on the checking site it says that signature's invalid
Is this normal?
Thx u Patrick, nice, amazing tutorial
I love your udemy course!
Happy to hear that! Thank you so much!
Hey Patrick, Thanks for awesome video .
do you have any video about how to save the user in Db and not on a static like now ? (User user = new User right now) ...
15:41 Can you explain why the login method works ? You're sending the values "string" while in your code the user's username and password are both set to Empty ... In my opinion this should have not worked with either "string" or "string1" ... I'm a bit confused
They are empty initially but in every test he does "register" a user which fills the fields in the memory then logins.
@@ReotteCetelle how to connect with sql database? sir
Thanks for it, dude! I’m need it
Hi problem in saving Hashed PW and Salt into sql server using dapper can you help in this please !!!
Thanks for this, Patrick!
Great tutorial
Thank you! Cheers!