This is the completed project corresponding to the guide "Protect your API endpoints".
Install dependencies:
composer install
Copy the file .env.example
to .env
and fill in your Okta issuer and audience configuration.
Run the app with the built-in PHP server:
php -S 127.0.0.1:8080 -t public
Get an access token by using an OAuth client such as https://example-app.com/client. Make a request with that access token to this API, such as:
curl -H "Authorization: Bearer TOKEN" http://127.0.0.1:8080/api/whoami