This is a demo project showing how to implement a custom authenticator based on a JWT with Serverless framework, PHP and Bref.
$ make install
$ make deploy
Access to a public resource:
$ curl https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/public
Access to a private resource and get the error message:
$ curl https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/private
Login and get a JWT:
$ curl -X POST https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/login
Access to a private resource:
$ curl -H "Authorization: Bearer <JWT>" https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/private