JWT Authentication in ASP.NET Core 7 Web API

  Рет қаралды 19,636

Tech Yatra(Nishant Gupta)

Tech Yatra(Nishant Gupta)

Күн бұрын

Пікірлер: 103
@mohrahulrathi3669
@mohrahulrathi3669 5 ай бұрын
Thanks
@tech_yatra
@tech_yatra 5 ай бұрын
🤗
@MOHITYADAV-vk5xk
@MOHITYADAV-vk5xk Жыл бұрын
Hindi me dot ke liye sabse acchi video ❤
@tech_yatra
@tech_yatra Жыл бұрын
Thanks brother, keep supporting
@techyoutube6625
@techyoutube6625 Жыл бұрын
Very well explained, better than many English channels
@tech_yatra
@tech_yatra Жыл бұрын
Thanks for your kind words
@asifjamal-m8g
@asifjamal-m8g 11 ай бұрын
very informative. excellent
@tech_yatra
@tech_yatra 11 ай бұрын
Glad it was helpful!
@kiran-bobade
@kiran-bobade Жыл бұрын
very nicely expalin sir..best on you tube for .net
@tech_yatra
@tech_yatra Жыл бұрын
Thanks for your kind words. 🙏❤️😊
@vivekgujari9118
@vivekgujari9118 2 ай бұрын
Nice explanation.
@tech_yatra
@tech_yatra 2 ай бұрын
Thanks Vivek.
@pwn16
@pwn16 Жыл бұрын
nice keep uploading videos
@tech_yatra
@tech_yatra Жыл бұрын
Thank you, I will
@Aman-ih8ub
@Aman-ih8ub 5 ай бұрын
Very good Explanation!
@tech_yatra
@tech_yatra 5 ай бұрын
Glad it was helpful!
@ketanparab7462
@ketanparab7462 8 ай бұрын
Excellent explanation 🎉
@tech_yatra
@tech_yatra 8 ай бұрын
🙏 Thanks 👍
@ketanparab7462
@ketanparab7462 8 ай бұрын
@@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 8 ай бұрын
Sure, I will make.
@akc1308
@akc1308 9 ай бұрын
nice tutorial 🤘
@tech_yatra
@tech_yatra 9 ай бұрын
Thanks 🙏👍 kindly like share and subscribe.
@josbexerra8115
@josbexerra8115 6 ай бұрын
muchas gracias Mister muy bien explicado......
@tech_yatra
@tech_yatra 6 ай бұрын
Me alegro que te guste esto. muchas gracias por tus amables palabras.
@AnshuRaj12991
@AnshuRaj12991 3 ай бұрын
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 3 ай бұрын
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 3 ай бұрын
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 3 ай бұрын
​@@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 3 ай бұрын
@AnshuRaj12991 thank you so much 🙏👍
@Datta3
@Datta3 2 ай бұрын
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.
@tech_yatra
@tech_yatra Ай бұрын
Make sure you're adding the token as a Bearer Token in Postman headers. Check if the token is valid and your JWT setup in appsettings.json or Startup.cs is correct. Let me know if the issue persists!
@alisalim723
@alisalim723 3 ай бұрын
very very prefect
@tech_yatra
@tech_yatra 3 ай бұрын
Thank you for your kind words. ❤️
@jatinvyas2999
@jatinvyas2999 2 ай бұрын
Hello, Apne jo Jwt key, issuer,audience and subject likha setting file me, vo muje kaja se milega?
@tech_yatra
@tech_yatra Ай бұрын
Hello! JWT key, issuer, audience, aur subject aap manually settings file me define karte hain. Example: "JwtSettings": { "Key": "Your_Secret_Key", "Issuer": "yourdomain.com", "Audience": "yourclient.com" } Aap apne project ke liye custom values use kar sakte hain.
@SanjaySharma-s2d
@SanjaySharma-s2d 11 ай бұрын
Well explained, could you please explain it using stored procedure and password hashing
@tech_yatra
@tech_yatra 11 ай бұрын
Sure I will make a video on this soon.
@pisht1998
@pisht1998 6 ай бұрын
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
@nasirrazahazara322
@nasirrazahazara322 18 күн бұрын
what is need of creating IAuthService?
@mhassaan7405
@mhassaan7405 2 ай бұрын
How to perform authorization in same code?
@tech_yatra
@tech_yatra Ай бұрын
For authorization, you can see the next video.
@asifjamal-m8g
@asifjamal-m8g 10 ай бұрын
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 10 ай бұрын
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 8 ай бұрын
Could you please create video on refresh token?
@tech_yatra
@tech_yatra 8 ай бұрын
Sure I will create
@user-et6wu8vr9y
@user-et6wu8vr9y 11 ай бұрын
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 11 ай бұрын
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 11 ай бұрын
If you have any other questions feel free to ask. Thank you
@user-et6wu8vr9y
@user-et6wu8vr9y 11 ай бұрын
@@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 6 ай бұрын
@@user-et6wu8vr9y Have you get this solution how did he get that values of key, issuer, audience...???
@user-et6wu8vr9y
@user-et6wu8vr9y 6 ай бұрын
@@ayushchourasiya4616nope, Those are random itseems
@poojatarge2580
@poojatarge2580 11 ай бұрын
How to generate key dynamically.. here we are hardcoding which is not secure
@tech_yatra
@tech_yatra 11 ай бұрын
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.
@kakdiyaamit6625
@kakdiyaamit6625 10 ай бұрын
hum Userwise database create karke. connection string change kar sakte hai login time par?
@SanjaySharma-s2d
@SanjaySharma-s2d 11 ай бұрын
Please explain how to consume this web api
@tech_yatra
@tech_yatra 11 ай бұрын
Sure, I will
@MuhammadAliSherserve
@MuhammadAliSherserve 9 ай бұрын
how you created jwt key, issuer, audience and subject json?
@tech_yatra
@tech_yatra 7 ай бұрын
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);
@chinmaykshah
@chinmaykshah 11 ай бұрын
very informative. can you try to make video on auth0?
@tech_yatra
@tech_yatra 11 ай бұрын
Sure, the next video is on auth0, and will be uploaded on the weekend. Thanks for your kind words 🙏☺️
@chinmaykshah
@chinmaykshah 10 ай бұрын
@@tech_yatra Hi,when are you planning to upload auth0 video?
@GauravSrivastava2609
@GauravSrivastava2609 4 ай бұрын
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 4 ай бұрын
Sure this is in my list
@TheRippleFamily225Family
@TheRippleFamily225Family Жыл бұрын
@atulbhandari2786
@atulbhandari2786 11 ай бұрын
Hello sir .token jb expire hota h to phir vo generate kaise hota h ?
@tech_yatra
@tech_yatra 11 ай бұрын
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 11 ай бұрын
Like agr mai continuously work kr rha hu...token expire time 20 minutes.after 20 minutes kya hoga?
@tech_yatra
@tech_yatra 11 ай бұрын
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 11 ай бұрын
Thank you sir
@atulbhandari2786
@atulbhandari2786 11 ай бұрын
Sir I have one question regarding dot net ...how to convert database table result to image format in aap net core web api ?
@soumenmondal38
@soumenmondal38 4 ай бұрын
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
@ashishingle9298
@ashishingle9298 7 ай бұрын
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 7 ай бұрын
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 7 ай бұрын
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 7 ай бұрын
@@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. 🙏🏻♥️
@vivekkanhekar1991
@vivekkanhekar1991 10 ай бұрын
Postman me data Get nhi hora h jab test kiya toh
@tech_yatra
@tech_yatra 10 ай бұрын
Agar koi issue hai aap mail pe details send kr dijiye me check krke btata hu
@vivekkanhekar1991
@vivekkanhekar1991 10 ай бұрын
Mail Id?@@tech_yatra
@tech_yatra
@tech_yatra 10 ай бұрын
thetechyatra@gmail.com
@vivekkanhekar1991
@vivekkanhekar1991 10 ай бұрын
@@tech_yatra I sent you my issue on your mail id
@debajyotimohanty7613
@debajyotimohanty7613 6 ай бұрын
Bhai iska database ka script mil sakta hai kya please?
@tech_yatra
@tech_yatra 6 ай бұрын
I do not have a db script. You can do the migration as I did by following the same steps.
@pieceofcode_
@pieceofcode_ 3 ай бұрын
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 3 ай бұрын
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.
@motiversityark
@motiversityark Жыл бұрын
Please your make video How to make forget password in asp .net core web api in user?
@tech_yatra
@tech_yatra Жыл бұрын
Sure I will add this to my list, you will get it soon.
@firdaushalam2067
@firdaushalam2067 7 ай бұрын
Can I talk to you by mob.
@tech_yatra
@tech_yatra 7 ай бұрын
Could you please write here ?
@RAHULYADAV-ck4vk
@RAHULYADAV-ck4vk 7 ай бұрын
your video are very informative,but I contact with you..plz reply bro🙏
@tech_yatra
@tech_yatra 7 ай бұрын
I am glad you like my videos. Thanks for your kind words ☺️🙏
@RAHULYADAV-ck4vk
@RAHULYADAV-ck4vk 7 ай бұрын
@@tech_yatra bro Aapse kaise contact kr skte hai..plz reply back🙏
@tech_yatra
@tech_yatra 7 ай бұрын
Aap thi pe bta dijiye ......ki kya puchna hai aapko
@MuhammadUsman-tn6bi
@MuhammadUsman-tn6bi 3 ай бұрын
sir apki videos dakh dakh k maine apk bohat views barhaye hain kindly kuch paisay meray b bantay hain :D
@tech_yatra
@tech_yatra 3 ай бұрын
Thank you so much Bhai .... Sunkar achha lgta hai
@tech_yatra
@tech_yatra 3 ай бұрын
Bhai abhi to paisy aane suru hi nhi hue hai
@ashokp5805
@ashokp5805 Ай бұрын
what hindi man, very bad understanding and time waste, tell in english only
@tech_yatra
@tech_yatra Ай бұрын
Sorry man....but I teach technology in hindi here.
@ersuresh4488
@ersuresh4488 7 ай бұрын
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 7 ай бұрын
Konsa part aapko samajh nhi aaya mujhe btao ...I will explain you
@AnandRaj-hq4zv
@AnandRaj-hq4zv 9 ай бұрын
Can you share code?
@tech_yatra
@tech_yatra 9 ай бұрын
Kindly check the video description...you will find the repo url there.
25 1 6, p 13931, 6강, API 기초 작업
5:09
루프코딩 연구소
Рет қаралды 12
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
What is JWT token and JWT vs Sessions
26:12
Chai aur Code
Рет қаралды 109 М.
27 dotnet core web api interview questions with answer | Hindi
1:06:11
ASP.NET Core Full Course For Beginners
3:43:18
Julio Casal
Рет қаралды 548 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН