JWT Authentication - Part 1: Golang w/ Gin Backend Setup

  Рет қаралды 11,817

david hwang

david hwang

Күн бұрын

Пікірлер: 24
@dhij
@dhij 3 жыл бұрын
0:00 Intro 0:52 Create repo & initialize Git 4:09 Create main.go 5:11 Gin Framework 7:04 Create endpoint for /api/register 9:08 Define User struct in the DTO 11:46 Create the errors package 15:02 Create user service 17:52 Encrypt password using bcrypt 19:39 Create Data Access Object (DAO) 20:27 Configure mysql database 23:04 MySQL workbench 27:24 Write query to insert user in the DAO 33:34 Define endpoints for /api/login, /api/get, & api/logout 34:23 Create the controller, service, & dao for /api/login 43:27 Generate JWT token using the jwt-go package 48:00 Create the controller, service, & dao for /api/user 49:03 Parse JWT Token 57:43 Remove cookie for /api/logout 59:14 Resolving CORS policy error using gin-contrib/cors package 1:01:15 Run main.go & dry run using Postman
@jakubklimek5012
@jakubklimek5012 3 жыл бұрын
The best video about jwt in gin so far
@pss_crs
@pss_crs 2 жыл бұрын
I'm not sure you have that in mind but you also have a good description of architecture and workflow
@dhij
@dhij 2 жыл бұрын
Appreciate that!
@Juswahh
@Juswahh 2 жыл бұрын
Exactly what I wanted to learm today.. thank you youre awesome my friend
@dhij
@dhij 2 жыл бұрын
Glad it helped!
@sustainedcruelty
@sustainedcruelty 2 жыл бұрын
Thanks so much for making this. It was super useful and easy to understand!
@dhij
@dhij 2 жыл бұрын
thats awesome! appreciate that!
@min-of8cv
@min-of8cv 3 жыл бұрын
Nice & clear explanation, keep up the good work. Hopefully there would be a part 2.
@dhij
@dhij 3 жыл бұрын
Thank you! Yup, I will have part 2 out real soon!
@lucamanfrin6456
@lucamanfrin6456 2 жыл бұрын
Awesome stuff! It would also be cool to see how you would deploy this app
@dhij
@dhij 2 жыл бұрын
Thanks! Yup I will make some of those in the future.
@chusovles
@chusovles 2 жыл бұрын
*dispatch(login(email, password))* _Argument of type 'ThunkAction' is not assignable to parameter of type 'AnyAction'._ How to resolve this error? Thanks!
@dhij
@dhij 2 жыл бұрын
Are you getting this error in the login screen when you try to call the dispatch() function inside the submit handler? My guess is that you did not specify the type for your login function in src/actions/userActions.tsx. Please refer to 18:12 of this video: kzbin.info/www/bejne/hmGVXqSaabOqm6c
@yakup4861
@yakup4861 2 жыл бұрын
Great video! Can you update the github repository by any chance? The frontend is missing some files.
@qizhang5749
@qizhang5749 2 жыл бұрын
Do you have a github link of the final result?
@unlite2896
@unlite2896 2 жыл бұрын
Please clarify how safe it is to use JWT authorization without refresh token and even more so to save the token in a cookie?
@dhij
@dhij 2 жыл бұрын
This is just a demo project covering the basics so is only suitable for development purposes and unfortunately not production-ready safe.
@andifaizal6848
@andifaizal6848 Жыл бұрын
Great
@dhij
@dhij Жыл бұрын
Thank you!
@namtruong4071
@namtruong4071 2 жыл бұрын
Good Content. Besides, Could you please speak louder. The volume is so low.
@dhij
@dhij 2 жыл бұрын
My bad on that, I started using a microphone from the following video!
@Ben-uh4wt
@Ben-uh4wt 2 жыл бұрын
Hi, enjoying the video as someone who is fairly new to Go. Could you explain why (in /utils/errors/rest_error.go) we return a reference to the RestErr in NewInternalServorError() and NewBadRequestError()? Is it to avoid having overhead due to copying the RestErr later?
@dhij
@dhij 2 жыл бұрын
Hey Ben! You are right, if we pass by reference, we would only need to create the RestErr struct once and pass it around. I made a video on pointers recently and you can refer to 7:33 here: kzbin.info/www/bejne/ZmfXgKtmbdism5I Refer to 2:46 as well, where I talk about how a variable that is initialized in a function is automatically stored in the heap.
JWT Authentication - Part 2: React Typescript Authentication Page
49:18
OAuth 2.0 and OpenID Connect (in plain English)
1:02:17
OktaDev
Рет қаралды 1,7 МЛН
Mom had to stand up for the whole family!❤️😍😁
00:39
Зу-зу Күлпаш 2. Бригадир.
43:03
ASTANATV Movie
Рет қаралды 729 М.
Бенчик, пора купаться! 🛁 #бенчик #арти #симбочка
00:34
Симбочка Пимпочка
Рет қаралды 3 МЛН
Архитектура Go проекта на практике
30:09
Evrone Development
Рет қаралды 16 М.
JWT Authentication in Go (Gin/Gorm)
35:26
Coding with Robby
Рет қаралды 73 М.
Building a Go Authentication System (Native)
16:44
Golang Dojo
Рет қаралды 17 М.
Go API Tutorial - Make An API With Go
38:03
Tech With Tim
Рет қаралды 183 М.
Build A Go REST API, React.js & TypeScript Todo Application
38:17
Golang Authentication with JWT, using Gin-Gonic and MongoDB
22:33
Akhil Sharma
Рет қаралды 34 М.
#36 Golang - Mastering JWT Authentication
22:31
codeHeim
Рет қаралды 2 М.
Mom had to stand up for the whole family!❤️😍😁
00:39