No description, website, or topics provided.
Switch branches/tags
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.
src
.eslintrc
.gitignore
LICENSE.md
README.md
app.json
index.js
package-lock.json
package.json

README.md

Automatic OAuth Example App

This is a node.js app that demonstrates how to authenticate with Automatic using OAuth. It demonstrates the use of the Automatic REST API.

Demo

A demo version of this application is available at http://automatic-oauth-example-nodejs.herokuapp.com/.

One-Click deploy to Heroku

Click this button to instantly deploy this app to Heroku. You'll need an Automatic client ID and secret.

Deploy

After deploying, you will need to use the Automatic Developer Apps Manager to set your application's redirect URL to match the Heroku app name you selected when deploying. For instance, if you name your app oauth-test in Heroku your redirect URL should be https://oauth-test.herokuapp.com/redirect. Note that the URL must start with https.

Running Locally

Prerequisites

Install node.js

brew install node

Install required modules

npm install

Configure your client id and client secret

Add your Automatic client id to package.json's automatic section or as environment variable.

Secret ID has to be passed through dedicated environment variable!

Those environment variables are, respectively, AUTOMATIC_CLIENT_ID and AUTOMATIC_CLIENT_SECRET.

Run the app

npm start

View the app

Open localhost:3000 in your browser.

Deploy to Heroku

If you have the heroku toolbelt installed, you can create, configure and deploy this app to Heroku. To create an app:

heroku create

If you already created an app, add it as a git remote:

git remote add heroku YOUR-HEROKU-GIT-URL

Configure the heroku app's environment variables:

heroku config:add AUTOMATIC_CLIENT_ID="YOUR AUTOMATIC CLIENT ID"
heroku config:add AUTOMATIC_CLIENT_SECRET="YOUR AUTOMATIC CLIENT SECRET"

Deploy your app to heroku:

git push heroku master

See deploying a node.js app for more information.

Support

Please write to developer@automatic.com if you have any questions or need help.

License

This project is licensed under the terms of the Apache 2.0 license.