Skip to content

Latest commit

 

History

History
 
 

README.md

Table of Contents

How To

Install

$ cd examples/[example-folder]
$ npm install

OAuth

Most of the examples are using Facebook and Twitter for showcasing the OAuth2 and OAuth1 flow respectively.

Create OAuth apps for Facebook and Twitter and set their redirect_uri accordingly:

  • http://localhost:3000/connect/facebook/callback
  • http://localhost:3000/connect/twitter/callback

Config

Add your OAuth app credentials in config.json

Start

$ node app.js

Login

Navigate to the following URLs in your browser:

  • http://localhost:3000/connect/facebook
  • http://localhost:3000/connect/twitter

Specific Examples

Static Overrides - Login

The static overrides example have a bunch of login URLs:

  • http://localhost:3000/connect/facebook
  • http://localhost:3000/connect/facebook/photos
  • http://localhost:3000/connect/facebook/videos
  • http://localhost:3000/connect/twitter
  • http://localhost:3000/connect/twitter/write

Dynamic Overrides - Login

Navigate to http://localhost:3000/form in your browser and pick a few scopes to test dynamic override via POST request.

Navigate to http://localhost:3000/connect/facebook?scope=user_photos%2Cuser_videos in your browser to test dynamic overrides via GET request.

Path Prefix - OAuth

Create OAuth apps for Facebook and Twitter and set their redirect_uri accordingly:

  • http://localhost:3000/path/prefix/connect/facebook/callback
  • http://localhost:3000/path/prefix/connect/twitter/callback

JWT - Create self-signed certificates

# generate private key
openssl genrsa 2048 > private.pem
# generate the self signed certificate
openssl req -x509 -new -key private.pem -out public.pem