JWT Authentication in ASP.NET Core 7 Web API

  Рет қаралды 17,516

Tech Yatra(Nishant Gupta)

Tech Yatra(Nishant Gupta)

Күн бұрын

Пікірлер: 95
@MOHITYADAV-vk5xk
@MOHITYADAV-vk5xk Жыл бұрын
Hindi me dot ke liye sabse acchi video ❤
@tech_yatra
@tech_yatra Жыл бұрын
Thanks brother, keep supporting
@techyoutube6625
@techyoutube6625 10 ай бұрын
Very well explained, better than many English channels
@tech_yatra
@tech_yatra 10 ай бұрын
Thanks for your kind words
@vivekgujari9118
@vivekgujari9118 19 күн бұрын
Nice explanation.
@tech_yatra
@tech_yatra 18 күн бұрын
Thanks Vivek.
@soumenmondal38
@soumenmondal38 2 ай бұрын
sir your explanation is very workable in my project. Please send me how to inject AES algorithm in this project if possible. It will be very helpful to me thank you
@SanjaySharma-s2d
@SanjaySharma-s2d 9 ай бұрын
Well explained, could you please explain it using stored procedure and password hashing
@tech_yatra
@tech_yatra 9 ай бұрын
Sure I will make a video on this soon.
@kiran-bobade
@kiran-bobade 10 ай бұрын
very nicely expalin sir..best on you tube for .net
@tech_yatra
@tech_yatra 10 ай бұрын
Thanks for your kind words. 🙏❤️😊
@asifjamal-m8g
@asifjamal-m8g 9 ай бұрын
very informative. excellent
@tech_yatra
@tech_yatra 9 ай бұрын
Glad it was helpful!
@pieceofcode_
@pieceofcode_ Ай бұрын
good explanation. I have a query regarding where to use? 1. If we use gRPC, are we not repeating model information? one in our .NET or Java application and same model in proto buff file? 2. If I use in in Authentication api, so is flow like below Ocelot -> Authentication Microservice -> gRPC client code -> gRPC server ?
@tech_yatra
@tech_yatra Ай бұрын
Thanks for your question! Yes, in gRPC, the model is defined twice - once in your .NET/Java app and once in the protobuf file. The protobuf helps in fast and efficient communication between services, even if it seems like repetition. Your flow looks correct: Ocelot -> Authentication Microservice -> gRPC client -> gRPC server.
@GauravSrivastava2609
@GauravSrivastava2609 2 ай бұрын
Well explained viseo, could you please make Refresh JWT Token video also. Or if you already make please share video link. Thanks
@tech_yatra
@tech_yatra 2 ай бұрын
Sure this is in my list
@Aman-ih8ub
@Aman-ih8ub 2 ай бұрын
Very good Explanation!
@tech_yatra
@tech_yatra 2 ай бұрын
Glad it was helpful!
@Datta3
@Datta3 15 күн бұрын
The POST API is not working in Postman. Are there any default settings required for Postman? I am passing the token, but it's not working. When I remove the Authorization attribute from the employee endpoint, all APIs work in both Swagger and Postman.
@pwn16
@pwn16 10 ай бұрын
nice keep uploading videos
@tech_yatra
@tech_yatra 10 ай бұрын
Thank you, I will
@alisalim723
@alisalim723 Ай бұрын
very very prefect
@tech_yatra
@tech_yatra Ай бұрын
Thank you for your kind words. ❤️
@user-et6wu8vr9y
@user-et6wu8vr9y 9 ай бұрын
Hello Nishant, Very well explained , thanks for this. Can you please tell me how can we get the Jwt to configure in Appsettings.json file, how did you get that key ,issuer and audience?
@tech_yatra
@tech_yatra 9 ай бұрын
This information will be used later to generate a JSON Web Token. Note that you can give any name to this section you want. You can use www.random.org/strings to generate random strings. Make sure you are not doing this for production
@tech_yatra
@tech_yatra 9 ай бұрын
If you have any other questions feel free to ask. Thank you
@user-et6wu8vr9y
@user-et6wu8vr9y 9 ай бұрын
@@tech_yatra : Yes please, I want to know how you got this values of Key, Issuer, Audience. Please guide me. Its very grateful you saw my message and responding. "Jwt": { "Key": "Yh2k7QSu4l8CZg5p6X3Pna9L0Miy4D3Bvt0JVr87UcOj69Kqw5R2Nmf4FWs03Hdx", "Issuer": "JWTAuthenticationServer", "Audience": "JWTServicePostmanClient", "Subject": "JWTServiceAccessToken" }
@ayushchourasiya4616
@ayushchourasiya4616 4 ай бұрын
@@user-et6wu8vr9y Have you get this solution how did he get that values of key, issuer, audience...???
@user-et6wu8vr9y
@user-et6wu8vr9y 4 ай бұрын
@@ayushchourasiya4616nope, Those are random itseems
@jatinvyas2999
@jatinvyas2999 12 күн бұрын
Hello, Apne jo Jwt key, issuer,audience and subject likha setting file me, vo muje kaja se milega?
@akc1308
@akc1308 7 ай бұрын
nice tutorial 🤘
@tech_yatra
@tech_yatra 7 ай бұрын
Thanks 🙏👍 kindly like share and subscribe.
@ketanparab7462
@ketanparab7462 6 ай бұрын
Could you please create video on refresh token?
@tech_yatra
@tech_yatra 6 ай бұрын
Sure I will create
@chinmaykshah
@chinmaykshah 8 ай бұрын
very informative. can you try to make video on auth0?
@tech_yatra
@tech_yatra 8 ай бұрын
Sure, the next video is on auth0, and will be uploaded on the weekend. Thanks for your kind words 🙏☺️
@chinmaykshah
@chinmaykshah 8 ай бұрын
@@tech_yatra Hi,when are you planning to upload auth0 video?
@asifjamal-m8g
@asifjamal-m8g 8 ай бұрын
Hi Nishant how r u. pls help Employee data which we are getting by consuming this api as in video and HOW we post it into another api Employee table whose column are different from out db employee column? how we mapp out employeeModel and other api employeeModel.
@tech_yatra
@tech_yatra 8 ай бұрын
To map Employee data to another API with different columns, use a mapping library like AutoMapper. Define a mapping between your EmployeeModel and the target API's EmployeeModel. After mapping, use HttpClient to send a POST request to the other API with the mapped data. Feel free to ask if you have more questions!
@ketanparab7462
@ketanparab7462 6 ай бұрын
Excellent explanation 🎉
@tech_yatra
@tech_yatra 6 ай бұрын
🙏 Thanks 👍
@ketanparab7462
@ketanparab7462 6 ай бұрын
@@tech_yatra thank you for your reply sir. Your explanation is very easy to understand. One request to you, Could you pleae make video on microservices in c# like API gateway Authorization and authentication microservices Comunicate microservices each other
@tech_yatra
@tech_yatra 6 ай бұрын
Sure, I will make.
@josbexerra8115
@josbexerra8115 4 ай бұрын
muchas gracias Mister muy bien explicado......
@tech_yatra
@tech_yatra 4 ай бұрын
Me alegro que te guste esto. muchas gracias por tus amables palabras.
@pisht1998
@pisht1998 3 ай бұрын
How do we validate this token i mean what if we make change in this generated token how we know that this is not the correct token
@kakdiyaamit6625
@kakdiyaamit6625 7 ай бұрын
hum Userwise database create karke. connection string change kar sakte hai login time par?
@mohrahulrathi3669
@mohrahulrathi3669 2 ай бұрын
Thanks
@tech_yatra
@tech_yatra 2 ай бұрын
🤗
@franciscoprazzio225prazzio
@franciscoprazzio225prazzio Жыл бұрын
@SanjaySharma-s2d
@SanjaySharma-s2d 9 ай бұрын
Please explain how to consume this web api
@tech_yatra
@tech_yatra 9 ай бұрын
Sure, I will
@poojatarge2580
@poojatarge2580 8 ай бұрын
How to generate key dynamically.. here we are hardcoding which is not secure
@tech_yatra
@tech_yatra 8 ай бұрын
Thanks for your comment! Generating keys dynamically for Jwt authentication in .NET 7 Web API is a great consideration for improved security. To achieve this dynamically, you can explore using a secure key generation mechanism, perhaps leveraging libraries like System.Security.Cryptography. I appreciate your emphasis on security, and I'll definitely consider creating content on dynamic key generation in an upcoming video. Feel free to subscribe for updates! If you have any more questions or suggestions, please let me know.
@MuhammadAliSherserve
@MuhammadAliSherserve 6 ай бұрын
how you created jwt key, issuer, audience and subject json?
@tech_yatra
@tech_yatra 5 ай бұрын
The values for the audience, issuer, and subject in a JWT are typically determined based on your application's context and requirements Issuer (iss): "my-app" Audience (aud): "my-app-users" Subject (sub): "user123" Values: Issuer (iss): "my-app" Audience (aud): "my-app-users" Subject (sub): "user123" Code: javascript Copy code const jwt = require('jsonwebtoken'); const payload = { sub: 'user123', iss: 'my-app', aud: 'my-app-users', exp: Math.floor(Date.now() / 1000) + (60 * 60) }; const secretKey = 'your-secret-key'; const token = jwt.sign(payload, secretKey); console.log(token);
@AnshuRaj12991
@AnshuRaj12991 Ай бұрын
Bro mera token swagger pe nhi aa rha hai but mai debugger lagaakar check kar rha hu to generate ho rha hai can you explain why did happen bro mai 2 din se try kar rha hu but swagger pe show hi nhi ho rha hai token😢😢
@AnshuRaj12991
@AnshuRaj12991 Ай бұрын
Issue solved I did only small mistake I use void return type in login action method where I generate token. So token not showing in swagger and thank you nishant bro ☺🙏🙏
@tech_yatra
@tech_yatra Ай бұрын
Great Bhai......aapne khud se issue resolve kr liya.... confidence aata hai .....and achha lgta hai .....pls subscribe to the channel and share it with others ☺️
@AnshuRaj12991
@AnshuRaj12991 Ай бұрын
​@@tech_yatra Ha bhai jab ham khud se apne problems ko resolve karte hai to hame ekk confidence ane lgta hai.... I already subscribed your channel and I will share your channel with friends ...
@tech_yatra
@tech_yatra Ай бұрын
@AnshuRaj12991 thank you so much 🙏👍
@mindset1ark
@mindset1ark 9 ай бұрын
Please your make video How to make forget password in asp .net core web api in user?
@tech_yatra
@tech_yatra 9 ай бұрын
Sure I will add this to my list, you will get it soon.
@ashishingle9298
@ashishingle9298 5 ай бұрын
Authentication hone ke bad jo JWT token generate hoga use kaha store karna chahiye frontend me take next time protected API ko call karte time use kar sake... Please help me to get answer for this.
@tech_yatra
@tech_yatra 5 ай бұрын
JWT token ko securely store karne ke liye localStorage, sessionStorage, ya httpOnly cookies use kar sakte hain. HttpOnly cookies sabse secure hain kyunki ye XSS attacks se bachata hai. Hope this helps.
@tech_yatra
@tech_yatra 5 ай бұрын
JWT token ko front-end me store karne ke liye, aap localStorage, sessionStorage, ya httpOnly cookies ka istemal kar sakte hain.localStorage aur sessionStorage JavaScript se accessible hote hain jabki httpOnly cookies XSS attacks se bachate hain.
@ashishingle9298
@ashishingle9298 5 ай бұрын
@@tech_yatra thanks a lot for replying. Agar ho sake to ek short video is topic pe bhi bana dijiye is topic pe clear information wali video nahi hai. 🙏🏻♥️
@atulbhandari2786
@atulbhandari2786 9 ай бұрын
Hello sir .token jb expire hota h to phir vo generate kaise hota h ?
@tech_yatra
@tech_yatra 9 ай бұрын
Jab JWT token expire ho jata hai, server-side logic naya token generate karta hai. Yeh process server policies aur client interaction par depend karta hai. Agar kuch aur poochna hai, feel free to ask!
@atulbhandari2786
@atulbhandari2786 9 ай бұрын
Like agr mai continuously work kr rha hu...token expire time 20 minutes.after 20 minutes kya hoga?
@tech_yatra
@tech_yatra 9 ай бұрын
Refresh tokens are the kind of tokens that can be used to get new access tokens. When the access tokens expire, we can use refresh tokens to get a new access token from the authentication controller.
@atulbhandari2786
@atulbhandari2786 9 ай бұрын
Thank you sir
@atulbhandari2786
@atulbhandari2786 9 ай бұрын
Sir I have one question regarding dot net ...how to convert database table result to image format in aap net core web api ?
@debajyotimohanty7613
@debajyotimohanty7613 4 ай бұрын
Bhai iska database ka script mil sakta hai kya please?
@tech_yatra
@tech_yatra 4 ай бұрын
I do not have a db script. You can do the migration as I did by following the same steps.
@vivekkanhekar1991
@vivekkanhekar1991 8 ай бұрын
Postman me data Get nhi hora h jab test kiya toh
@tech_yatra
@tech_yatra 8 ай бұрын
Agar koi issue hai aap mail pe details send kr dijiye me check krke btata hu
@vivekkanhekar1991
@vivekkanhekar1991 8 ай бұрын
Mail Id?@@tech_yatra
@tech_yatra
@tech_yatra 8 ай бұрын
thetechyatra@gmail.com
@vivekkanhekar1991
@vivekkanhekar1991 8 ай бұрын
@@tech_yatra I sent you my issue on your mail id
@RAHULYADAV-ck4vk
@RAHULYADAV-ck4vk 4 ай бұрын
your video are very informative,but I contact with you..plz reply bro🙏
@tech_yatra
@tech_yatra 4 ай бұрын
I am glad you like my videos. Thanks for your kind words ☺️🙏
@RAHULYADAV-ck4vk
@RAHULYADAV-ck4vk 4 ай бұрын
@@tech_yatra bro Aapse kaise contact kr skte hai..plz reply back🙏
@tech_yatra
@tech_yatra 4 ай бұрын
Aap thi pe bta dijiye ......ki kya puchna hai aapko
@MuhammadUsman-tn6bi
@MuhammadUsman-tn6bi Ай бұрын
sir apki videos dakh dakh k maine apk bohat views barhaye hain kindly kuch paisay meray b bantay hain :D
@tech_yatra
@tech_yatra Ай бұрын
Thank you so much Bhai .... Sunkar achha lgta hai
@tech_yatra
@tech_yatra Ай бұрын
Bhai abhi to paisy aane suru hi nhi hue hai
@firdaushalam2067
@firdaushalam2067 5 ай бұрын
Can I talk to you by mob.
@tech_yatra
@tech_yatra 5 ай бұрын
Could you please write here ?
@ersuresh4488
@ersuresh4488 4 ай бұрын
Jo main part h es video ka usko sirf copy paste Kiya h no explanation.. so no use of watching this video
@tech_yatra
@tech_yatra 4 ай бұрын
Konsa part aapko samajh nhi aaya mujhe btao ...I will explain you
@AnandRaj-hq4zv
@AnandRaj-hq4zv 6 ай бұрын
Can you share code?
@tech_yatra
@tech_yatra 6 ай бұрын
Kindly check the video description...you will find the repo url there.
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 1,1 МЛН
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 35 МЛН
What is JWT token and JWT vs Sessions
26:12
Chai aur Code
Рет қаралды 86 М.
JWT авторизация. Основы JWT - механизма.
6:45
Хочу вАйти
Рет қаралды 15 М.
oAuth for Beginners - How oauth authentication🔒 works ?
10:43
What Is JWT and Why Should You Use JWT
14:53
Web Dev Simplified
Рет қаралды 1,2 МЛН
Is ASP.NET Core Better than Laravel?
16:35
Gavin Lon
Рет қаралды 2,7 М.