OAuth2 client where you provide the client credentials to test the 3-legged authorization flow.
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.
.circleci ci - adding gcloud deploy. Aug 18, 2018
src app - changing how secure cookies are configured. (#54) Nov 19, 2016
test
.dockerignore
.editorconfig
.gcloudignore
.gitignore
.jshintignore
.jshintrc
.nvmrc chore - switching to use npmrc. (#67) May 15, 2018
Dockerfile docker - adding docker file. (#68) Aug 11, 2018
LICENSE
README.md
app.yaml
docker-compose.yml docker - adding docker-compose and updating readme. (#69) Aug 11, 2018
gruntfile.js
package-lock.json Update grunt-contrib-jshint to the latest version 🚀 (#72) Oct 6, 2018
package.json Update grunt-contrib-jshint to the latest version 🚀 (#72) Oct 6, 2018
server-local.js ci - moving prod code to a 'src' folder. (#39) Nov 12, 2016

README.md

OAuth2 Client Shell

Build Status

A client mock where the user provides the information to initiate the OAuth2 authorization flow. Hosted on https://oauth2-client-shell.neverendingqs.com/.

This app always assumes it has HTTPS terminated in front of a load balancer, and that it can be trusted (i.e. app.enable('trust proxy');).

Running

npm install

# Running in production and/or without HTTPS
npm start

# Running it with a self-signed certificate for local use only
npm run dev

This app is also available as a container.

# Running it using docker-compose with a self-signed certificate for local use only
docker-compose up

Navigate to http://localhost:3000 for the HTTP endpoint, and https://localhost:3001 for the HTTPS endpoint.

Environment Variables

All environment variables are optional. They allow you to pre-populate fields on initial page load.

The environment variables are:

  • DEFAULT_AUTH_CODE_SCOPE
  • DEFAULT_AUTH_ENDPOINT
  • DEFAULT_CLIENT_ID
  • DEFAULT_CLIENT_SECRET
  • DEFAULT_CUSTOM_PARAMS
  • DEFAULT_TOKEN_ENDPOINT

Contributing

npm run dev will run the application with HTTPS and restart + jshint upon any js file changes. The HTTP port is based on the environment variable PORT (defaults to 3000), while the HTTPS port is PORT + 1 (defaults to 3001)

Include a .env file to automatically set environment variables while running locally. Example:

DEFAULT_AUTH_CODE_SCOPE=profile
DEFAULT_AUTH_ENDPOINT=https://accounts.google.com/o/oauth2/v2/auth
DEFAULT_CLIENT_ID=812741506391.apps.googleusercontent.com
DEFAULT_CLIENT_SECRET=abc123
DEFAULT_CUSTOM_PARAMS=access_type=online
DEFAULT_TOKEN_ENDPOINT=https://www.googleapis.com/oauth2/v4/token