Skip to content

tomaszkiewicz/passport-pg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

passport-pg

passport-pg enables you to run passport authentication with PostgreSQL backend.

Installation

npm install passport
npm install passport-pg

Configuration

To enable authentication using passport-pg in your existing infrastructure you have to and add some passport's code and call passportPg

var passportPg = require('passport-eg');
passportPg(connectionString, passport, app);

The arguments are:

  • connectionString - connestion string to your PostgreSQL database
  • passport - passport object
  • app - your express app

Example

var express = require('express');
var http = require('http');
var passportPg = require('passport-eg');
var passport = require('passport');

var app = express();

app.set('port', process.env.PORT || 4000);

app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.bodyParser());
app.use(express.session({ secret: 'secret' }));
app.use(passport.initialize());
app.use(passport.session());

var config = require('./config');

passportPg(config.connectionString, passport, app);

http.createServer(app).listen(app.get('port'), function(){
    console.log('Express server listening on port ' + app.get('port'));
});

Version

0.1.1

License

BSD-3

Tests

Not yet available

Release History

  • 0.1.1 Added cache of user object
  • 0.1.0 Initial release

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published