passport-mspassport

0.0.8 • Public • Published

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'));

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.8
    0
    • latest

Version History

Package Sidebar

Install

npm i passport-mspassport

Weekly Downloads

0

Version

0.0.8

License

MIT

Last publish

Collaborators

  • mattdot