A sample Ktor backend API to support the Auth0 frontend application.
The code is progressively built up over three branches:
- starter - the base API with no authentication or authorization. This branch is discussed in this post.
- add-authorization - the API requiring a valid access token for the
protected
andadmin
endpoints. - add-rbac - the API requiring special permissions to access the
admin
endpoint.
Set the following environment variables:
export ISSUER=https://<yourdomain>.auth0.com
export AUDIENCE=<api audience>
Build with ./gradlew installDist
.
Run with ./build/install/com.matthewcasperson.ktor-demo/bin/com.matthewcasperson.ktor-demo
.