A node.js service to to proxy the API

You might be in the wrong place

You probably want to use

I just separated this module for the fun of it. You can use it on its own, but I didn't expect that anyone would.


This proxy's the lds-connect API in your app so that your front-end javascript (and, in particular, angular-lds-connect) can make calls to

In the future, when supports CORS (and employs the proper security measures), this module will not be necessary.

Questions? Comments? Leave an issue or join the discussion on Google Groups


npm install --save passport-lds-connect
npm install --save lds-connect-proxy



var ldsConnectProxy
function getAccessTokenFromSession(req) {
  // flavor to the way you handle sessions in your app 
  return req.user && req.user.accessToken;
function getUserIdFromSession(req) {
  return req.user && req.user.ldsId;
ldsConnectProxy = require('lds-connect-proxy').create(getAccessTokenFromSession, getUserIdFromSession);
// Express 
// Connect 
// if (!connect.router) { connect.router = require('connect_router'); } 
// app.use(connect.router(ldsConnectProxy)); 

In order to get an access token in the first place you will need to use passport-lds-connect. See for example usage.