A simple example of how to use OAuth to authorise your app with the Assembly Platform.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
views
.gitignore
README.md
app.js
package.json

README.md

Assembly NodeJS OAuth Example

Hi there. This repository is a really simple example of how to build a basic OAuth flow. The Assembly Platform uses OAuth tokens to protect school data and your application will, therefore, need to implement the Assembly Platform OAuth flow in order to let schools see to which of their data your application is requesting access.

We've created this repo because first time users of OAuth are often unsure about how to implement the necessary steps and browser testing really isn't the best way to kick the tyres on the Assembly Platform's OAuth because we need to call your appliction back once the school (or, in this case, probably your test school) has approved your application for access to their data.

Up and Running

To use this example you'll need NodeJS v5 installed (the sample should work on later versions but has not been tested). Before you get started on this you'll need to create an application on the Assembly Platform. To do that read this.

When configuring an app on the sandbox environment to try out this example you need to be sure you set the callback URI to http://localhost:8080/auth/assembly/callback unless you've modified the code to listen on a different port etc.

Once you've done that you should have an application ID and secret that you can substitute in the commands below.

  npm install
  APP_ID=<your app id> APP_SECRET=<your app secret> node app.js

Now you can visit the Node app by going to http://localhost:8080/ in your browser.