This a proof-of-concept API-proxy based on the OAuth 2.0 Client Example by D2L Company.
This sample is not production-ready as-is, and is meant to only run locally.
This sample uses Node.js, and it must be installed before proceeding.
Use https://localhost:3001/callback
when providing the redirect URI during application registration.
These environment variables must be set:
- CLIENT_ID
- The OAuth 2.0 client ID (available from the Brightspace OAuth 2.0 registration page)
- CLIENT_SECRET
- The OAuth 2.0 client secret (available from the Brightspace OAuth 2.0 registration page)
- HOST_URL
- The URL of the Brightspace instance (e.g.
https://myschool.brightspace.com
)
- The URL of the Brightspace instance (e.g.
A file named .devenv.json
with the following structure can be used to automatically set environment variables:
{
"CLIENT_ID": "<client_id>",
"CLIENT_SECRET": "<client_secret>",
"HOST_URL": "<host_url>"
}
Run the following:
npm install
npm run dev
Then navigate to https://localhost:3001/
.
And then navigate to https://localhost:3001/upsert-courseoffering
.