Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wpcodevo/golang-fiber-jwt
In this comprehensive guide, you'll learn how to implement JWT (JSON Web Token) authentication in a Golang application using GORM and the Fiber web framework.
https://github.com/wpcodevo/golang-fiber-jwt
api fiber fiber-framework golang gorm gorm-orm http-server jwt jwt-authentication postgresql rest-api
Last synced: 28 days ago
JSON representation
In this comprehensive guide, you'll learn how to implement JWT (JSON Web Token) authentication in a Golang application using GORM and the Fiber web framework.
- Host: GitHub
- URL: https://github.com/wpcodevo/golang-fiber-jwt
- Owner: wpcodevo
- Created: 2023-01-30T20:50:31.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T08:05:32.000Z (about 1 year ago)
- Last Synced: 2024-05-15T15:32:42.527Z (7 months ago)
- Topics: api, fiber, fiber-framework, golang, gorm, gorm-orm, http-server, jwt, jwt-authentication, postgresql, rest-api
- Language: Go
- Homepage: https://codevoweb.com/golang-gorm-fiber-jwt-authentication/
- Size: 29.3 KB
- Stars: 40
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang, GORM, & Fiber: JWT Authentication
In this comprehensive guide, you'll learn how to implement JWT (JSON Web Token) authentication in a Golang application using GORM and the Fiber web framework. The REST API will be powered by a high-performance Fiber HTTP server, offering endpoints dedicated to secure user authentication, and persist data in a PostgreSQL database.
![Golang, GORM, & Fiber: JWT Authentication](https://codevoweb.com/wp-content/uploads/2023/01/Golang-GORM-Fiber-JWT-Authentication.webp)
## Topics Covered
- Run the Golang & Fiber JWT Auth Project
- Setup the Golang Project
- Setup PostgreSQL and pgAdmin with Docker
- Create the GORM Model
- Database Migration with GORM
- Load the Environment Variables with Viper
- Create the Database Pool with GORM
- Migrate the GORM Model to the Database
- Create the JWT Authentication Controllers
- SignUp User Fiber Context Handler
- SignIn User Fiber Context Handler
- Logout User Fiber Context Handler
- Get the Authenticated User
- Create the JWT Middleware Guard
- Register the Routes and Add CORS
- Testing the JWT Authentication Flow
- Register a New Account
- Log into the Account
- Access Protected Routes
- Logout from the APIRead the entire article here: [https://codevoweb.com/golang-gorm-fiber-jwt-authentication/](https://codevoweb.com/golang-gorm-fiber-jwt-authentication/)