Skip to content

Provides AAF Rapid Connect implementation to your Sails.js application.

License

Notifications You must be signed in to change notification settings

shilob/sails-aaf-rapid-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>' 
  }
}

About

Provides AAF Rapid Connect implementation to your Sails.js application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published