- Notifications
You must be signed in to change notification settings - Fork35
In this comprehensive guide, you will learn how to secure a Golang RESTful API with JSON Web Tokens and Email verification.
wpcodevo/golang-gorm-postgres
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This article will teach you how to secure a Golang application with access and refresh tokens using GORM, Postgres, Docker, and Docker-compose. Also, you will learn how to use the RS256 algorithm with private and public keys to sign the tokens.
- Golang, Gin & GORM JWT Authentication Overview
- JWT Authentication Example with Golang and GORM
- Generate the Private and Public Keys
- Load and Validate the Environment Variables
- Create the Database Models with GORM
- Run the Database Migration with GORM
- Hash and Verify the Passwords with Bcrypt
- Sign and Verify the RS256 JSON Web Tokens
- Function to Generate the Tokens
- Function to Verify the Tokens
- Create the Authentication Route Controllers
- Register User Controller
- Login User Controller
- Refresh Access Token Controller
- Logout Controller
- Create a Middleware Guard
- Create a User Controller
- Authentication Routes
- User Routes
- Add the Routes to the Gin Middleware Stack
Read the entire article here:https://codevoweb.com/golang-gorm-postgresql-user-registration-with-refresh-tokens
Articles in this series:
How to Setup Golang GORM RESTful API Project with Postgres
API with Golang + GORM + PostgreSQL: Access & Refresh Tokens
Golang and GORM - User Registration and Email Verification
About
In this comprehensive guide, you will learn how to secure a Golang RESTful API with JSON Web Tokens and Email verification.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.