This project is only for learning purposes. A simple microservice for storing user credentials and authenticating them.
The REST api is documented and generated with OpenApi spec. The tool for generation is deepmap/oapi-codegen.
-
Golang 1.18 or higher
-
running MySQL Database instance
- use files in /SQL to setup the db
- dsn for the database is setup in app.go at 24th line
git clone https://github.com/Nesquiko/go-auth.git
cd go-auth
go run .
To interact with running Go-Auth service, either go through the OpenApi spec and use a client of your choice. Or use Postman, you can import the collection and environment in /postman dir.
- signup new user
- log in with credentials, and get unauthenticated token
- setup 2FA
- verify 2FA TOTP password, and get fully authenticated token
- use test endpoint test endpoint if you are correctly authenticated