https://github.com/pfazzi/aws-php-custom-authorizers-api
A demo project showing how to implement a custom authenticator based on a JWT for Serverless framework with PHP and Bref.
https://github.com/pfazzi/aws-php-custom-authorizers-api
authorization aws bref jwt php serverless
Last synced: about 1 month ago
JSON representation
A demo project showing how to implement a custom authenticator based on a JWT for Serverless framework with PHP and Bref.
- Host: GitHub
- URL: https://github.com/pfazzi/aws-php-custom-authorizers-api
- Owner: pfazzi
- Created: 2020-08-03T14:57:43.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-05T07:40:26.000Z (almost 5 years ago)
- Last Synced: 2025-02-16T11:16:03.268Z (3 months ago)
- Topics: authorization, aws, bref, jwt, php, serverless
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a demo project showing how to implement a custom authenticator based on a JWT
with Serverless framework, PHP and Bref.### Install and Deploy
```bash
$ make install
$ make deploy
```### Test
Access to a public resource:
```bash
$ curl https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/public
```
Access to a private resource and get the error message:
```bash
$ curl https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/private
```
Login and get a JWT:
```bash
$ curl -X POST https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/login
```
Access to a private resource:
```bash
$ curl -H "Authorization: Bearer " https://{app-id}.execute-api.{region}.amazonaws.com/dev/api/private
```