A set of tools and example applications for Product Education courses.
The Expenses API is a simple api that is secured using the express-oauth2-bearer module.
Variable | Value | Default |
---|---|---|
ISSUER_BASE_URL | https://your-tenant.region.auth0.com | ❌ |
ALLOWED_AUDIENCES | https://expenses-api | ✅ |
PORT | 5000 | ✅ |
Endpoint | Secure | Scopes |
---|---|---|
/ |
❌ | |
/total |
❌ | |
/reports |
✅ | read:reports |
ISSUER_BASE_URL=https://your-tenant.region.auth0.com \
npm run expenses-api:secure:start
https://vercel.com/new/git/external
?repository-url=https%3A%2F%2Fgithub.com%2Fauth0%2Fauth0-product-education-labs%2Ftree%2Fmaster%2Fapis%2Fexpenses-api-secured
&env=
ISSUER_BASE_URL,
VERCEL_URL,
ALLOWED_AUDIENCES
&project-name=expenses-api
&repository-name=expenses-api
The Unsecured Expenses API is a simple api that is intended to be used as a starting point for hands on labs.
Variable | Value | Default |
---|---|---|
ISSUER_BASE_URL | https://your-tenant.region.auth0.com | ❌ |
ALLOWED_AUDIENCES | https://expenses-api | ✅ |
PORT | 5000 | ✅ |
Endpoint | Secure | Scopes |
---|---|---|
/ |
❌ | |
/total |
❌ | |
/reports |
❌ |
ISSUER_BASE_URL=https://your-tenant.region.auth0.com \
npm run expenses-api:start
https://vercel.com/new/git/external
?repository-url=https%3A%2F%2Fgithub.com%2Fauth0%2Fauth0-product-education-labs%2Ftree%2Fmaster%2Fapis%2Fexpenses-api-unsecured
&env=
ISSUER_BASE_URL,
VERCEL_URL,
ALLOWED_AUDIENCES
&project-name=expenses-api-unsecured
&repository-name=expenses-api-unsecured
The initial deploy tool is intended to be used as a test deployment between GitHub and Vercel.
No environment variables are needed for initial deploy.
npm run initial-deploy:start
https://vercel.com/new/git/external
?repository-url=https%3A%2F%2Fgithub.com%2Fauth0%2Fauth0-product-education-labs%2Ftree%2Fmaster%2Ftools%2Finitial-deploy
&project-name=initial-deploy
&repository-name=initial-deploy
The tools and examples in this repository can be run in a number of ways. Each are specific to the task you are trying to accomplish. They are presented here in order or invasiveness to your local machine. For learners, the intention is to use Vercel.
- Vercel - using a cloud based hosting environment
- GitHub Codespaces - using a cloud based IDE and runtime
- VS Code Remote Development - using Docker Desktop to isolate development in a local container. This avoids needing to install developer runtimes on your local machine while allowing to you continue working locally.
- Local - using your local development environment
Vercel is a cloud based hosting service. Each individual tool and sample application can be deployed to Vercel by clicking the blue Deploy button.
A wizard dialog will guide you through the deployment process.
The overall repository and each individual tool or sample includes a devcontainer definition. GitHub Codespaces can utilize it to create a completely web based IDE and execution environment. No installs are needed.
To use, from the GitHub project page:
- Click the green Code button.
- Click the Open with Codespaces menu option.
- Click the New codespace button.
The Codespace will be created and the project will load into the web based VS Code IDE.
Note: Once the Codespace is created, you do not need to create it again. Simply select it from the Codespace menu.
The overall repository and each individual tool or sample includes a devcontainer definition. This is to facilitate the use of a self contained docker image containing all the development dependencies.
- Install Docker Desktop.
- Right-click on the Docker task bar item and update Settings / Preferences > Shared Drives / File Sharing with any source code locations you want to open in a container.
- Install VS Code.
- Install the Remote Development Extension Pack.
- Open the root directory of the repository in VS Code.
- Click Reopen In Container on the remote development notification dialog.
All of the tools and sample applications can be run locally assuming dependecies are installed on the local machine. To prepare for local execution run npm install
and then npm run init
from the root of the repository.
Project assumes a working nodejs environment and has been tested using the following versions.
Tool | Version | Install |
---|---|---|
Node.js | v12.15.0 | https://nodejs.org/dist/v12.19.0/node-v12.19.0.pkg |
NPM | v6.14.8 | npm install npm@latest -g |
NVM (optional) | v0.36.0 | https://github.com/nvm-sh/nvm |
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
For auth0 related questions/support please use the Support Center.
This project follows the all-contributors specification. Contributions of any kind welcome!
Please review our Code of Conduct and Contributing guidelines.
This project is licensed under the MIT license. See the LICENSE file for more info.