Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 API

Read the entire article here: [https://codevoweb.com/golang-gorm-fiber-jwt-authentication/](https://codevoweb.com/golang-gorm-fiber-jwt-authentication/)