mcasperson / Auth0Ktor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A sample Ktor backend API to support the Auth0 frontend application.

Branches

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 and admin endpoints.
  • add-rbac - the API requiring special permissions to access the admin endpoint.

Compiling and running

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.

About