sails-aaf-rapid-connect

0.0.3 • Public • Published

Sails AAF Rapid Connect

If you're using Sails.js, an even more rapid way of authenticating with AAF :)

Installation

Install the module in your Sails app:

$ npm install sails-aaf-rapid-connect --save

Create a service named 'userLoginService' with the following methods:

module.exports = {
  /**
  * payload - Object, AAF attributes, see RapidAAF documentation
  * req - Sails.js request object
  * res - Sails.js response object
  */
  validUser: function(payload, req, res) {
    // called when user is valid, you can do whatever you want, etc.
    // return res.redirect(url);
  },
  /**
  * reason - string 
  * req - Sails.js request object
  * res - Sails.js response object
  */
  invalidUser: function(reason, req, res) {
    sails.log.error("User failed to login: " + reason);
    return res.json({failureReason: reason});
  }
};

Add the following configuration:

auth: {
  jwsSecret:'<The Secret used when registering the AAF Service>', 
  algo: 'HS256',
  aaf: {
    login_url:'<The Unique URL AAF provided after registering>' 
  }
}

Readme

Keywords

Package Sidebar

Install

npm i sails-aaf-rapid-connect

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • shilo