GO JWT Authentication with Gin Gonic - complete series in single video

Поділитися
Вставка
  • Опубліковано 17 жов 2024
  • 💪 Buy my awesome golang course - akhilsharmatec...
    👊 Join my FREE discord community to learn new technologies - / discord
    💯 Follow me on twitter - / akhilairi
    💥💥 Enroll In my Udemy Course - www.udemy.com/...
    🎌🎌 Join this channel to get access to perks:
    / @akhilsharmatech
    🚨 🚨 🚨 Subscribe so that you're notified when more GO / Rust / Solidity videos come out - / @akhilsharmatech
    👋👋👋 CONNECT with me ON LINKEDIN - / akhilsails
    ⚡⚡ Series for 22 Killer Projects in Golang - • 56 KILLER GOLANG Proje...
    🔥🔥 JWT Authentication Project Series with Golang - • [ Complete Course ] GO...
    🤯🤯 Golang complete Restaurant Management Project series - • [ Complete Course ] Go...
    💸💸 Golang complete Ecommerce Project series -
    • [COMPLETE COURSE] - Go...
    ⚡⚡ Series For URL Shortening Series With Golang - • [ Complete Course ] GO...
    💣💣 A Simple microservice with Golang - • [ Complete Project ] G...
    🎌🎌Golang Bing scraper Series - • [Complete Course] Gola...
    🐘🐘 Golang with Postrgres series - • [ Complete Course ] Po...
    ✔️✔️Golang and ReactJS TODO Series - • [ Complete Course ] GO...
    💫💫 Golang and ReactJS chat App - • [COMPLETE COURSE ] GO ...
    ✨✨Golang Google Scraper Series - • [ Complete Course ] Go...
    ⭐⭐Golang Sitemap Crawler Series - • [Complete GO Course] C...
    🔥🔥Advice For Engineers Playlist - • Advice for Engineers
    ⭐⭐BulletProof CRUD Apis with Golang and DynamoDB - • [ Complete Course ] GO...
    🔒🔒 Golang CSRF Token Series, complete Project - • [Complete GO Course] C...

КОМЕНТАРІ • 50

  • @RajivKumarYadavRK
    @RajivKumarYadavRK 8 місяців тому +5

    00:02 Learn JWT authentication using Golang with Gin Gonic and MongoDB
    02:28 Setting up the Go project for JWT authentication
    07:09 Installing the Go MongoDB driver and using bson for defining JSON properties.
    09:52 Setting up JSON validation for user data
    15:26 Setting up router and routes
    17:52 Using Gin Gonic makes API handling cleaner and simpler
    21:46 Corrected function name and began setting up project structure
    23:46 Implementing user routes with Gin Gonic
    28:18 Setting up database connection and controller for user data
    30:29 Setting up environment variables and log for error handling.
    35:02 Creating functions to connect to MongoDB and open a specific collection
    37:37 Setting up database connection and initial controllers
    42:45 Implementing the get user function with access restrictions.
    44:49 Using different project structures and frameworks in Golang
    48:33 Handling user authentication and access control with JWT in Gin Gonic
    50:54 Implementing role-based access control for user authentication
    55:56 Handling server errors and planning for potential future improvements.
    58:03 Creating a user signup function with Gin Gonic
    1:03:28 Handling user count and error in JWT authentication
    1:06:10 Using time package in Golang for handling timestamps
    1:10:45 Passing user information and generating tokens
    1:13:03 Inserting user data into the database with error handling
    1:17:05 Setting up Golang JWT authentication with Gin Gonic
    1:19:12 Creating JWT token with Gin Gonic
    1:23:35 Handling errors in JWT authentication
    1:26:05 Setting token expiry and refresh claims
    1:31:06 Detailed video covering token refresh, validation, and user insertion.
    1:33:23 Handling user authentication and error handling in JWT authentication using Gin Gonic
    1:38:42 Using bcrypt library for comparing hash and password
    1:40:49 Building a bulletproof authentication system for reusability
    1:44:46 Adding validations is like adding salt to a dish - it's customizable.
    1:46:57 Generating tokens with user details
    1:51:54 Creating and updating JWT tokens
    1:54:52 Updating user data in MongoDB using Gin Gonic
    1:59:09 Building custom frameworks for enhanced security
    2:00:38 Creating reusable authentication and authorization logic in Golang
    2:03:46 Explaining code for better understanding
    2:05:39 Building logic for pagination in Gin Gonic with MongoDB aggregation
    2:09:41 Understanding the purpose of group id and dollar sum function.
    2:12:21 Use dollar push on the root to get access to the data alongside the count.
    2:16:14 Proper syntax and brackets usage in MongoDB aggregation
    2:18:16 Using aggregation for grouping and counting in MongoDB
    2:22:52 Creating middleware for JWT authentication in Gin Gonic
    2:25:10 Creating a function to validate the client token.
    2:30:59 Implementing token expiration check
    2:33:23 Setting context and running the project
    2:38:21 Debugging errors in database connection
    2:40:25 Golang provides accurate error messages and allows writing all code at once.
    2:44:36 Fixing compilation errors in the code
    2:46:46 Fixing errors while setting up JWT authentication with Gin Gonic
    2:51:31 Demonstration of token authentication and routing in Golang
    2:53:24 Encouraging viewers to subscribe and stay tuned

  • @pawanjumani99
    @pawanjumani99 Рік тому +1

    the BEST channel i came across with. Love your content.

  • @АлександрМаксимов-о1ы

    Hey, mate! Thank you a lot for your videos. Can you answer please on couple questions?
    Why u use log.Panic in your controller before c.JSON..., i think that first u need to right c.JSON sentence and after use log.Panic?
    And why you use defer cancel() couple times, i think that u can use it once, before all if-return loops.
    Thank you, it would be great if you answer me on it:)

    • @shera2667
      @shera2667 Рік тому

      you are right, the panic should go after c.JSON and also we can use the cancel directly in main.go as well

  • @yusufakinleye2300
    @yusufakinleye2300 2 роки тому

    Waooh, just what I need at the moment. Have been troubleshooting the JWT middleware unauthorized routes for days back. Bravo 👍👌

  • @cashcowislive
    @cashcowislive Рік тому +3

    While creating User struct at the very start, Why have you mentioned pointer to the string type?

  • @matthew1106
    @matthew1106 7 місяців тому

    Such a relaxing coding session. You seem like a great person to work with.

  • @musbell
    @musbell 2 роки тому +1

    Thanks for the video, this is very helpful. I am planning to migrate my startup's backend project from Nodejs to Golang and I try using Gqlgen, Ent and Gin to build a graphql api but I am having some difficulties to set it up. I would be glad if you could share a video on this combination or you can kindly recommend. 🙂

  • @mozammilkarim8636
    @mozammilkarim8636 Рік тому +1

    Hi, In controller.go file, line 86
    user.User_id = user.ID.Hex()
    here this error is coming on compile time -> cannot use user.ID.Hex() (value of type string) as type *string in assignment, I tried to fix this using temp := user.ID.Hex()
    user.User_id = &temp , but then it creates problem on run time, can you hint where is problem. thanks

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

    This is a perfect refresher. Thanks!

  • @stevechao-e4d
    @stevechao-e4d Рік тому

    Thank you very much for sharing this wonderful video! It's very helpful to me for learning go language.

  • @jiwanjeon3319
    @jiwanjeon3319 2 роки тому +1

    I really appreicate Akhil for JWT video! if you don't mind, could you cover Oauth too? After watching your JWT video, I also want to see your Oauth video too!

  • @harkishandudhrejiya3553
    @harkishandudhrejiya3553 Рік тому +2

    Very Nice Video. Thanks for this sir.
    Sir, Could you please also teach how to write test cases for whole project on the same video series?

  • @shivaprasadch
    @shivaprasadch Рік тому

    Thanks for a great video. Simple and crystal clear explanation too. BTW, usually clients don't want to send PW in the plain text format. ibut here, we are expecting in plain text format. if server and client uses same hash key and method, and client send hashed PW, this problem can be solved.

    • @MisterMacintosh1
      @MisterMacintosh1 Рік тому +1

      Clients never send a hashed password, otherwise the salt would be compromised

  • @asutoshpanda1508
    @asutoshpanda1508 2 роки тому

    damn...you are consistent out of the box, I just did the HRMS using fiber and mongodb upto half 4 days and between these 4 days you have uploaded 4 more projects

  • @arya83o292
    @arya83o292 Рік тому

    Excusme sir, do u have video about go authorization? I cant find it on your youtube channels

  • @someshnayak8314
    @someshnayak8314 3 місяці тому

    Best Course on jwt authentication

  • @zulfiqar7967
    @zulfiqar7967 2 роки тому

    Rust or Go .. which is to go for after learning solidity..?

  • @MaheshKumar-bg5re
    @MaheshKumar-bg5re Рік тому

    Hi.. Thanks for the video.. Is that jwt package maintained..? I checked in github, it says package is not maintained.. What is the alternative?

  • @stevechao-e4d
    @stevechao-e4d Рік тому

    just have another one question, how to use the refresh_token in this case?

  • @timafinish1255
    @timafinish1255 Рік тому +1

    Hi, do you have github repo with the project?

  • @prabhakaran-dz7cp
    @prabhakaran-dz7cp Рік тому

    Thanks for the tutorial it helped a lot for learning jwt authorisation but when i try to used the getusers function in usercontrollers.go file its showing error in line 161 expected == instead of = can you help me to solve this

  • @wisdomelue
    @wisdomelue 11 місяців тому +1

    awesome video man!
    but the background music is not needed, it's very distracting

    • @AkhilSharmaTech
      @AkhilSharmaTech  11 місяців тому +1

      Yup, none of the newer videos have it

  • @irhamsahbana5210
    @irhamsahbana5210 2 роки тому

    thanks for made this video, i have a question, how to use refresh token?

  • @deathdefier45
    @deathdefier45 10 місяців тому

    Neat video brother, love the soundtrack ❤

    • @AkhilSharmaTech
      @AkhilSharmaTech  10 місяців тому

      Thank you bro. New ones are better. Do check 🙏

  • @parthibahazra9930
    @parthibahazra9930 2 роки тому +1

    Sir can you upload the project in Github , I am getting a panic err( strconv.ParseInt: parsing "2m": invalid syntax goroutine 335 ) and I couldn't find where actually it messed up.

    • @AkhilSharmaTech
      @AkhilSharmaTech  2 роки тому

      I think it's already there on my github profile pls check

    • @parthibahazra9930
      @parthibahazra9930 2 роки тому

      @@AkhilSharmaTech Actually Your GitHub link is not given in Video description so I thought it might not Uploaded yet

  • @WrestlingBattle
    @WrestlingBattle 2 роки тому

    Hey Akhil, I'm getting error: routes "golang-jwt-project/routes" of couldn't import
    Even I ran go mod tidy. Please help me. I'm using go1.17.5 version.

  • @kanhaiyakumarguptaiiitu7235
    @kanhaiyakumarguptaiiitu7235 11 місяців тому

    Can we get all users using cursors

  • @imam_an_15
    @imam_an_15 11 місяців тому +1

    Can i see your github project?

  • @vinay3894
    @vinay3894 6 місяців тому

    Great resource, Thanks.

  • @faisalmushtaq2287
    @faisalmushtaq2287 Рік тому

    video on multiple social auth please, like google and twitter

  • @ani.mishra
    @ani.mishra Рік тому

    Thank you bro

  • @shygrammer
    @shygrammer 2 роки тому

    is there a link to the git repo?

    • @AkhilSharmaTech
      @AkhilSharmaTech  2 роки тому

      pretty sure it's there on my github, i'm AkhilSharma90

  • @廖浚钧-k4l
    @廖浚钧-k4l 2 роки тому +3

    Don't you realize that your avatar obscures part of the code?

  • @captainperoxidecool9503
    @captainperoxidecool9503 Рік тому +1

    Ye banda GO ko khatam krke hi manega.

  • @culeforever5408
    @culeforever5408 5 місяців тому +1

    Done

  • @dineshsilwal9687
    @dineshsilwal9687 2 роки тому

    @Akhil Sharma I want you to make video on casbin rbac concept in golang ..

  • @kcalixto
    @kcalixto Рік тому

    bro hates golang extension

  • @vedgupta3589
    @vedgupta3589 Рік тому

    Hey Akhil , do you have any community - discord or something

  • @RajivKumarYadavRK
    @RajivKumarYadavRK 8 місяців тому +4

    00:02 Learn JWT authentication using Golang with Gin Gonic and MongoDB
    02:28 Setting up the Go project for JWT authentication
    07:09 Installing the Go MongoDB driver and using bson for defining JSON properties.
    09:52 Setting up JSON validation for user data
    15:26 Setting up router and routes
    17:52 Using Gin Gonic makes API handling cleaner and simpler
    21:46 Corrected function name and began setting up project structure
    23:46 Implementing user routes with Gin Gonic
    28:18 Setting up database connection and controller for user data
    30:29 Setting up environment variables and log for error handling.
    35:02 Creating functions to connect to MongoDB and open a specific collection
    37:37 Setting up database connection and initial controllers
    42:45 Implementing the get user function with access restrictions.
    44:49 Using different project structures and frameworks in Golang
    48:33 Handling user authentication and access control with JWT in Gin Gonic
    50:54 Implementing role-based access control for user authentication
    55:56 Handling server errors and planning for potential future improvements.
    58:03 Creating a user signup function with Gin Gonic
    1:03:28 Handling user count and error in JWT authentication
    1:06:10 Using time package in Golang for handling timestamps
    1:10:45 Passing user information and generating tokens
    1:13:03 Inserting user data into the database with error handling
    1:17:05 Setting up Golang JWT authentication with Gin Gonic
    1:19:12 Creating JWT token with Gin Gonic
    1:23:35 Handling errors in JWT authentication
    1:26:05 Setting token expiry and refresh claims
    1:31:06 Detailed video covering token refresh, validation, and user insertion.
    1:33:23 Handling user authentication and error handling in JWT authentication using Gin Gonic
    1:38:42 Using bcrypt library for comparing hash and password
    1:40:49 Building a bulletproof authentication system for reusability
    1:44:46 Adding validations is like adding salt to a dish - it's customizable.
    1:46:57 Generating tokens with user details
    1:51:54 Creating and updating JWT tokens
    1:54:52 Updating user data in MongoDB using Gin Gonic
    1:59:09 Building custom frameworks for enhanced security
    2:00:38 Creating reusable authentication and authorization logic in Golang
    2:03:46 Explaining code for better understanding
    2:05:39 Building logic for pagination in Gin Gonic with MongoDB aggregation
    2:09:41 Understanding the purpose of group id and dollar sum function.
    2:12:21 Use dollar push on the root to get access to the data alongside the count.
    2:16:14 Proper syntax and brackets usage in MongoDB aggregation
    2:18:16 Using aggregation for grouping and counting in MongoDB
    2:22:52 Creating middleware for JWT authentication in Gin Gonic
    2:25:10 Creating a function to validate the client token.
    2:30:59 Implementing token expiration check
    2:33:23 Setting context and running the project
    2:38:21 Debugging errors in database connection
    2:40:25 Golang provides accurate error messages and allows writing all code at once.
    2:44:36 Fixing compilation errors in the code
    2:46:46 Fixing errors while setting up JWT authentication with Gin Gonic
    2:51:31 Demonstration of token authentication and routing in Golang
    2:53:24 Encouraging viewers to subscribe and stay tuned