Authentication app built with JWT token with api gateway for authentication. Application simulates the JWT web token workflow.
-
Use
.env
file for each microservice. Default.env
file consists ofTOKEN_ENDPOINT
. Use any available port. General ports in use fall under 3xxx domain or 5xxxx domain. -
Simulate user, password authentication from db. For testing purposes, use
admin
andpassword
.Note:
In general use, the username, password should be retrieved from the db. Since we do not have that capability, we are using defaultadmin
andpassword
.This is NOT IDEAL in production env
. It is up to the client to configure this however they see fit. -
After user is succesfully logged in,
LICENSE
file should populate with the newly generated license key. All downstream api will need this api key. Client does not need to do anything at this time. Again this is not ideal. key must be safely stored in db and retrieved as a masked entity. -
Test by using
sample.http
REST CLIENT. AllVS Code
users should install theREST CLIENT
extension and test with the provided api. After the user is logged in from the token-generator api, update the retrieved token in the Authorization header (Some clients automatically do it for you. )
- Run
go mod tidy
to cleanup and install required deps. - Run
go run main.go
forapi_gateway
andjwt-tokens
.