Playlyfe passport authentication strategy for NodeJS
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
README.md
package.json

README.md

Passport-Playlyfe

Passport strategy for authenticating with the Playlyfe Platform

This module lets you authenticate using Playlyfe in your Node.js applications.

For accesing the complete Playlyfe API it is recommended you use this module with the Playlyfe NodeJS SDK

Install

npm install passport-playlyfe

Usage

Configure Strategy

passport = require('passport');
PlaylyfeOAuth2Strategy = require('passport-playlyfe');
...
passport.use( new PlaylyfeOAuth2Strategy({
  clientID: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  redirectURI: 'YOUR_REDIRECT_URI'
}, function(accessToken, refreshToken, profile, done) {
   // Custom application code
   done(null, profile);
}));

The redirect URI must match exactly with any of the registered redirect endpoints or the oauth flow will fail.

Authenticate Requests

Use passport.authenticate(), specifying the 'playlyfe' strategy, to authenticate requests.

For example in an express application with connect style middleware.

app.get('/auth/playlyfe', passport.authenticate('playlyfe'), function(req, res) {
   //Application code.
});

Example

For a complete example of a playlyfe application checkout the Playlyfe Express Application

License

The MIT License

Copyright(c) 2013-2014, Playlyfe Technologies, developers@playlyfe.com, http://dev.playlyfe.com/