No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
authorization_code
implicit_grant
.gitignore
Procfile
README.md
app.json
local.env
package.json

README.md

Mendeley Show Me Access Tokens

Introduction

This is a simple Node application that uses the Mendeley API and can be deployed to Heroku.

It demonstrates how to use the OAuth 2.0 Authorisation Code Flow and the Implicit Grant Type.

In each case it will make a call to the profiles service.

Prerequisites

  1. Install NPM

Getting started

  1. Register your client at the developer portal. Use dummy as your redirect URI. This will give you a client ID and secret.

  2. Click on the button below to deploy the app to Heroku. You will need to fill in the client ID and secret from the previous step.

Deploy

  1. Back at the developer portal, change your app's redirect URI to the Heroku HTTPS URL. For example, if your Heroku app's name is:

    secure-citadel-6801

    then your redirect URI should be:

    https://secure-citadel-6801.herokuapp.com/

Your app should now be deployed. You can now follow the instructions in the Heroku console to clone and edit the code.

Run authorisation code flow locally

  1. Clone the app using the instructions on the "Code" tab in the Heroku console.

  2. Register another client ID and secret, with the redirect URL http://localhost:5000/callback and store in a local.env file e.g.

  3. Run heroku local -e local.env to start the app, and go to http://localhost:5000 in your browser.

Run implicit flow locally

  1. Clone the app using the instructions on the "Code" tab in the Heroku console.

  2. Register another client ID and secret, with the redirect URL http://localhost:8888 and store in a local.env file e.g.

  3. Change the command to point to the app.js in the implicit_grant folder e.g. web: node implicit_grant/app.js $PORT $REDIRECT_URI $CLIENT_ID

  4. Run heroku local -e local.env to start the app, and go to http://localhost:8888 in your browser.

Further reading

mendeley-show-me-access-tokens