/oauth2.0-client-example

Using the OAuth 2.0 flow to get data from Brightspace APIs.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

OAuth 2.0 Client Example

This is a demonstration of how to obtain an access token to call Brightspace APIs on behalf of a user via the authorization code grant flow.

How to run this sample

This sample is not production-ready as-is, and is meant to only run locally.

Pre-requisites

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.

Environment variables

These environment variables must be set:

A file named .env with the following structure can be used to automatically set environment variables:

CLIENT_ID=<client_id>
CLIENT_SECRET=<client_secret>
HOST_URL=<host_url>

Running the sample

Run the following:

npm install
npm run dev

Then navigate to https://localhost:3001/.