Secure passwordless login OAuth demo
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.
public
.nvmrc
LICENSE
README.md
config.js
index.js
oauth-client.js
package.json

README.md

OAuth-Demo

OAuth-Demo is an example of a Relying Party application. This demo utilizes Trusted Key's wallet service to provide secure passwordless login support using the OAuth open standard.

Getting started

This application was developed under Node-js version 6.10.x. Use nvm to install the latest stable version of node v6.10.0.

Post installation, please do the below steps in folder where the repo is forked/downloaded.

  nvm install v6.10.0
  nvm use v6.10.0

To begin, obtain OAuth Client Id & Client Secre by registering a relying party application at developer.trustedkey.com. Detailed instructions on this can be found here.

Update the config.js file accordingly:

  config.localUrl = 'https://<where your application is hosted>';
  config.oauthClientId = '<client id>';
  config.oauthClientSecret = '<client secret>';
  config.authorizeCallbackRoute = '/<registered callback url route>';

Individual Claims Requests

Individual claims can be configured at,

OAuth-Demo/oauth-client.js -> OauthClient method -> claims object

Example:

"given_name": null

null -> Indicates that this Claim is being requested in the default manner. In particular, this is a Voluntary Claim.

"address": {
  "essential": true
}

JSON object -> essential (optional) -> Indicates whether the Claim being requested is an Essential Claim. If the value is true, this indicates that the Claim is an Essential Claim.

Install dependencies and run the application:

# Change to project directory
cd <project-directory>

# Install npm dependencies
npm install

# Run the applicationn
node index.js

# Access the applicationn
http://localhost:3000