Skip to content

A demo project showing how to implement a custom authenticator based on a JWT for Serverless framework with PHP and Bref.

Notifications You must be signed in to change notification settings

pfazzi/aws-php-custom-authorizers-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

$ make install
$ make deploy

Test

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

About

A demo project showing how to implement a custom authenticator based on a JWT for Serverless framework with PHP and Bref.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published