|
1 | | -#CRUD RESTful API with Golang + MongoDB + Redis + Gin Gonic |
| 1 | +#Golang & MongoDB: JWT Authentication and Authorization |
| 2 | + |
| 3 | +In this article, you'll learn how to implement RS256 JWT (JSON Web Token) Authentication and Authorization with Golang, Gin Gonic, MongoDB-Go-driver, and Docker-compose. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +##Topics Covered |
| 8 | + |
| 9 | +- Golang & MongoDB JWT Authentication Overview |
| 10 | +- JWT Authentication Example with Golang and MongoDB |
| 11 | +- How to Generate Public and Private Keys |
| 12 | +- Update Environment Variables with Viper |
| 13 | +- Creating the User models with structs |
| 14 | +- Creating an Auth and User Interfaces |
| 15 | +- Authentication Interface |
| 16 | +- User Interface |
| 17 | +- Create utility functions to hash and verify password |
| 18 | +- Create services that interact with the database |
| 19 | +- Auth interface implementation |
| 20 | +- User interface implementation |
| 21 | +- Create a utility function to sign and verify JWT tokens |
| 22 | +- Create Json Web Token |
| 23 | +- Verify JSON Web Token |
| 24 | +- Create the authentication controllers |
| 25 | +- Signup user controller |
| 26 | +- Login user controller |
| 27 | +- Refresh access token controller |
| 28 | +- Logout user controller |
| 29 | +- Authentication Middleware Guard |
| 30 | +- Create the user controllers |
| 31 | +- Create API Routes with Gin |
| 32 | +- Auth Routes |
| 33 | +- User Routes |
| 34 | +- Add the Routes to the Gin Middleware Pipeline |
| 35 | + |
| 36 | +Read the entire article here:[https://codevoweb.com/golang-mongodb-jwt-authentication-authorization](https://codevoweb.com/golang-mongodb-jwt-authentication-authorization) |
| 37 | + |
| 38 | +Articles in this series: |
2 | 39 |
|
3 | 40 | ###1. API with Golang + MongoDB + Redis + Gin Gonic: Project Setup |
4 | 41 |
|
|