@gaincompliance/hapi-auth-stormpath

1.1.25 • Public • Published

hapi-auth-stormpath

Stormpath authentication plugin for hapi

npm license

Build Status Codecov

Commitizen friendly semantic-release greenkeeper badge

Installation

$ npm install @gaincompliance/hapi-auth-stormpath -S

Usage

Include this plugin in the manifest of your hapi application to make the Stormpath authentication scheme available to your application. When registered for a route, a user will be directed to Stormpath's ID Site for your registered application to authenticate.

Once the scheme has been registered, register a strategy that uses the stormpath scheme provided by this plugin.

Configuration

When registering the strategy, be sure to provide the following required configuration:

  • apiKeyId (required) - the api key ID for your Stormpath application
  • apiKeySecret (required) - the api key secret from your Stormpath application
  • applicationHref (required) - the url that identifies your application according to the Stormpath API
  • returnUrl (required) - the fully qualified url that ID Site should send the user back to after authentication

Example

export function register(server, options, next) {
  server.auth.strategy('stormpath', 'stormpath', {
    apiKeyId: process.env.SP_API_KEY_ID,
    apiKeySecret: process.env.SP_API_KEY_SECRET,
    applicationHref: `https://api.stormpath.com/v1/applications/${process.env.STORMPATH_APPLICATION_ID}`,
    returnUrl: 'https://your.site.com/login'
  });

  next();
}

register.attributes = {
  name: 'authentication-strategy'    
};

Readme

Keywords

none

Package Sidebar

Install

npm i @gaincompliance/hapi-auth-stormpath

Weekly Downloads

2

Version

1.1.25

License

MIT

Last publish

Collaborators