No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Access Passport.js user information from connection using angular as client. Angular-Passport-Auth-SIO

This is a fork from the following

Major League help from Michael Robinson at faceleg

This is a complete demonstration of, passport, passport.socketio, firebird sql and angular.

I've included all the code for those it might help.



  • To install in windows from command prompt

  • md nodedemo

  • cd nodedemo

  • git clone

  • npm install

  • node server

  • install firebird and copy from adjuster.gdb from \database to wherever desired and change \Angular-Passport-Auth-SIO\server\models\cfg\cfg.json

  • in browser http://localhost:8000

  • [Firebird] ( ( open source sql database and can easily be replaced by mysql.

  • [] Henri Gourvest essential repo for using node with firebird

  • I use the database for local authentication (see \Server\Models\User.js)

  • socket.js uses the authenication credentials to bring only the data for logged in user. See \Server\socket.js and Usage

  • I will refactor this code asap to make it more efficient

  • After installing copy the ADJUSTER.GDB database to desired directory, make sure firebird service is running and change path on the "database" line in server / models / cfg / cfg.json file.


    socket.on('getclaims', function (data) {
        var user = socket.handshake.session;//.user_id;
        var adj = user.req.session.req.user.adjusterid; // added to passport
        console.log('== get only open claims for authenticated useer ', adj)
        qrystr = 'select CLAIM_ID "id", CLAIM_NO "title" , INSURED_ID, CLAIM_TYPE "type", ADJUSTER_ID, ACCOUNT_REP_ID "reporter" , INSURANCE_COMPANY_ID "assignee"  , \
            description,status "status",   DATE_OF_LOSS, POLICY_NUMBER,REPORTED,RECOVERY_COMMENTS,RECEIVED from CLAIM where ADJUSTER_ID= ? and status = 1 ';
        console.log('qrystr: ', qrystr, [adj ]);
        database.execute(qrystr, [adj], function (err, results, fields) {
            var jsondata = new Array();
            wrapJson(results, fields, jsondata);
            output = {"Claims": jsondata};
            socket.emit('initclaims', output);


Thanks to all who helped.