Laravel/Lumen sample project with a middleware to verify JWT tokens using public JWK.
- Git
- Docker
- docker-compose
- OAuth Server
-
At
docker-compose.yml
file fill the Environment Variables with your information- JWT_AUDIENCE : Audience (aud) of your token
- JWT_ISSUER: Issuer (iss) of your token
- JWKS_URL: URL to the JWKS keys at your OAuth2 server
-
Start the containers using the
docker-compose
command
docker-compose up
- Make a curl to the address
http://localhost:8000
without aAuthorization
header. You will receive a 401 error with a message.
curl http://localhost:8000
- Make a curl to the address
http://localhost:8000
with a valid Bearer token at theAuthorization
header. You will receive a 200 response.
curl -H 'Authorization: Bearer $ACCESS_TOKEN' http://localhost:8000