An open API service indexing awesome lists of open source software.

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.

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
```