Skip to content

Simple service that validates a login and returns a JWT token to be used to authorize a request into a helloworld api.

License

Notifications You must be signed in to change notification settings

filipelenfers/authJwt

Repository files navigation

CircleCI

AuthJWT Service

Deploy

  1. Compile and Assembly
sbt compile
sbt assembly
  1. Run terraform to create the dynamodb table needed:
cd terraform
terraform apply
cd ..
  1. Deploy serverless function and service.
sls deploy

A resume with the new api-key and service url will be outputed. 4. Test it:

curl -H "x-api-key: GET_APIKEY_GENERATE_ON_SLS_DEPLOY_AND_PASTE_HERE"  -X POST  https://YOU_API_URL.execute-api.us-east-1.amazonaws.com/dev/login -d  "{\"email\":\"[email protected]\",\"password\":\"mypassword\"}"

#COPY THE TOKEN GENERATED ABOVE

curl -H "Authorization: PASTE_TOKEN_HERE" https://YOU_API_URL.execute-api.us-east-1.amazonaws.com/dev/helloWorld

TODO

  • Make brief intro and architecture diagram
  • sls invoke local to test... see notes.txt
  • smm for all parameters
  • terraform control usage plans
  • unit testing
  • functional testing

About

Simple service that validates a login and returns a JWT token to be used to authorize a request into a helloworld api.

Resources

License

Stars

Watchers

Forks

Packages

No packages published