0.0.8 • Published 8 years ago

passport-mspassport v0.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

passport-mspassport

Build Status

PassportJS strategy for authenticating with Microsoft Passport and Windows Hello.

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

Install

$ npm install passport-mspassport

Usage

Configure Strategy

// configure passport to use the MSPassportStrategy
passport.use("mspassport", new MSPassportStrategy({
    protocol: "custom",
    protocolHandler: function (req, callback) {
        //get the public key for this request.  If it's part of the
        //HTTP request, then get it from the header/querystring/body.
        //If it's stored in a db and the request has a username, look
        //up the public key from there.
        callback({
            publicKey: "",
            challenge: "",
            signature: ""
        });
    },
    findUserByPublicKey: function (key, callback) {
        users.findUserByPublicKey(key, function(user) {
            callback({
                "id" : user.id,
                "displayName" : user.displayName,
                "preferredUserName" : user.preferredUserName
            });
        });
    }
}));

Authenticate Requests

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

For example, as route middleware in an Express application:

app.get('/auth/mspassport', passport.authenticate('mspassport'));
0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago