Clone this and adapt it to your needs.
This is a generic microservice that handles generating tokens for accessing your resource services. See comments above endpoints for more details for each endpoint.
Search for "generic" and replace it with your project name
To get started quickly, add a file called .env.local and add the following environment variables. In production, the program will read environment variables from the host environment
JWT_SECRET=Your JWT Secret
MONGODB_URI=Your database uri. Should start with mongodb.
GOOGLE_CLIENT_ID=Your Google Client ID
GOOGLE_CLIENT_SECRET=Your Google Client Secret
DATABASE_NAME=The main database where your users should be saved
go mod download
go run main.go
Currently only Google sign in is supported. I'm planning to add more providers soon.