{"_id":"authdog","_rev":"6-0e236f2fdc633ec0d9974732acab9c17","name":"authdog","description":"Provides functionality for working with the server side aspects of the U2F protocol.","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.2":{"name":"authdog","version":"0.0.2","description":"Provides functionality for working with the server side aspects of the U2F protocol.","main":"lib/u2f.js","scripts":{"test":"mocha"},"devDependencies":{"commander":"^2.5.0","mocha":"^2.5.3","virtual-u2f":"^0.0.9"},"repository":{"type":"git","url":"git+https://github.com/ryankurte/authdog.git"},"keywords":["u2f","server","library","2nd-factor","fido","auth","dog"],"author":{"name":"Ryan Kurte"},"contributors":[{"name":"Emile Cantin"},{"name":"Jacob Marshall"}],"license":"MIT","bugs":{"url":"https://github.com/ryankurte/authdog/issues"},"homepage":"https://github.com/ryankurte/authdog","gitHead":"ebd52a3fdda8c74404aeebe9fc9ed8f05c2da2a3","_id":"authdog@0.0.2","_shasum":"b343dea7ce6f48bb99289805b7d650dbfcd4e3be","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"ryankurte","email":"ryankurte@gmail.com"},"dist":{"shasum":"b343dea7ce6f48bb99289805b7d650dbfcd4e3be","tarball":"https://registry.npmjs.org/authdog/-/authdog-0.0.2.tgz","integrity":"sha512-712i8H+2UqPPpcVyJDeukqFgbMMQAGl1wmqR8aTGte2uceZ0T5+rH7iDfYvANAOSO5AtYpnXSKOpenec3Vdn7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM5HqO8W1YGYYYOr+j3EI9yMlyfw4QHFLXlgcAdk21DQIgM/0Fs2E9sdxBJCj1LM4NV6t+aJMrg1xGmYhskXH1XEI="}]},"maintainers":[{"name":"ryankurte","email":"ryankurte@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/authdog-0.0.2.tgz_1466573098948_0.7126603866927326"}},"0.1.0":{"name":"authdog","version":"0.1.0","description":"Provides functionality for working with the server side aspects of the U2F protocol.","main":"lib/u2f.js","scripts":{"test":"mocha"},"devDependencies":{"commander":"^2.5.0","mocha":"^2.5.3","virtual-u2f":"^0.1.2"},"repository":{"type":"git","url":"git+https://github.com/ryankurte/authdog.git"},"keywords":["u2f","server","library","2nd-factor","fido","auth","dog"],"author":{"name":"Ryan Kurte"},"contributors":[{"name":"Emile Cantin"},{"name":"Jacob Marshall"}],"license":"MIT","bugs":{"url":"https://github.com/ryankurte/authdog/issues"},"homepage":"https://github.com/ryankurte/authdog","gitHead":"c61ad7590f118a544d292d12ad8f2cb653c40d06","_id":"authdog@0.1.0","_shasum":"cf9820c43a4d5847d6afe40759967c3a14f6713d","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"ryankurte","email":"ryankurte@gmail.com"},"dist":{"shasum":"cf9820c43a4d5847d6afe40759967c3a14f6713d","tarball":"https://registry.npmjs.org/authdog/-/authdog-0.1.0.tgz","integrity":"sha512-4CsTANRxRbh5kP9I2lpCZLD1DQETZUJe+Y3hClGWT5P9BuFyIq77EXklCdYqkJ0ToLfVoxG1hzgw9sYzckGBGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTMYvluVeBp3NVkxN6pdLJ0aqb+mEkqS0bJPv3G3+X2AIhAMy4dePM3yriANf8WouSxhaTYxW8p8CDRANJtp24ZEhd"}]},"maintainers":[{"name":"ryankurte","email":"ryankurte@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/authdog-0.1.0.tgz_1467029422941_0.8911065999418497"}},"0.1.1":{"name":"authdog","version":"0.1.1","description":"Provides functionality for working with the server side aspects of the U2F protocol.","main":"lib/u2f.js","scripts":{"test":"mocha"},"devDependencies":{"commander":"^2.5.0","mocha":"^2.5.3","virtual-u2f":"^0.1.2"},"repository":{"type":"git","url":"git+https://github.com/ryankurte/authdog.git"},"keywords":["u2f","server","library","2nd-factor","fido","auth","dog"],"author":{"name":"Ryan Kurte"},"contributors":[{"name":"Emile Cantin"},{"name":"Jacob Marshall"}],"license":"MIT","bugs":{"url":"https://github.com/ryankurte/authdog/issues"},"homepage":"https://github.com/ryankurte/authdog","gitHead":"2bc3abc51e272f3bf0a671077f4510380bb610e3","_id":"authdog@0.1.1","_shasum":"d6e1412261300afb6f5a7baf68caa3cbef7ce1ae","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"ryankurte","email":"ryankurte@gmail.com"},"dist":{"shasum":"d6e1412261300afb6f5a7baf68caa3cbef7ce1ae","tarball":"https://registry.npmjs.org/authdog/-/authdog-0.1.1.tgz","integrity":"sha512-6ulYDWGiwbFE8nfuHv+q+oplJLI1XUMJAJF1oKQdVQvYu4y6w9CKKG/HRiGJWW1uEQ+UADpKy3guNS8MkqbEug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKUwohLOcvHxekJAPl5b/2xoewg0ZeDxKPB7Gk9Jcw1wIhAP9+BpOiB+rCD+mVKT6vJPkXMKrGHmwXDu2vaRsvJEvW"}]},"maintainers":[{"name":"ryankurte","email":"ryankurte@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/authdog-0.1.1.tgz_1467103506963_0.20016399514861405"}}},"readme":"AuthDog\n==================\n\nServer side U2F/FIDO library for Node.js. Provides functionality for registering and authenticating with U2F devices.  \n\nBased on @jacobmarshall's fork of @emilecantin's initial [implementation](https://github.com/emilecantin/node-u2flib-server). Altered to interact with the [high level interface](https://fidoalliance.org/specs/fido-u2f-v1.0-nfc-bt-amendment-20150514/fido-u2f-javascript-api.html#high-level-javascript-api) defined by the Fido specifications, and implemented by the [Yubico reference client api](https://demo.yubico.com/js/u2f-api.js).  \n\nRebuilt to support multiple u2f tokens, with a focus on simple integration (ie. human readable errors, solid input validation and sanitisation).  \n\nCheck out a simple example at [ryankurte/authdog-example](https://github.com/ryankurte/authdog-example).  \n\nStatus\n------\n\nModule is a work in progress, functionally working but needs better input validation and testing.  \nAPI is also subject to change if anything is found to be missing or better layouts become apparent.  \nCLI interface is currently fairly broken.  \n\n[![Build Status](https://travis-ci.org/ryankurte/authdog.svg)](https://travis-ci.org/ryankurte/authdog)  [![Dependencies](https://david-dm.org/ryankurte/authdog.svg)](https://david-dm.org/ryankurte/authdog) [![NPM](https://img.shields.io/npm/v/authdog.svg)](https://www.npmjs.com/package/authdog) \n\n\nInstallation\n------------\n\n```\nnpm install authdog\n```\n\n\nUsage\n-----\n\n```\nvar u2f = require('authdog');\n```\n\nThe u2f protocol consists of two main actions:\n- Registration, in which we associate specific device(s) with a user.\n- Authentication, in which we verify that the user is in possession of a previously registered device.\n\nEach of these actions consist of two phases: challenge and response.  \n\nAn application implementing U2F needs to store a set of information about tokens associated with each user account, henceforth referred to as 'token metadata' consisting of a key handle used to identify the keypair, the public key of the token, the usage count of the token, and optionally the token certificate.  \n\n### Device Registration\n\nTo start device registration use:\n```\n// Generate a registration request\nu2f.startRegistration(appId, existingKeys, {requestId: N, timeoutSeconds: 100})\n.then(function(registrationRequest) {\n  // Save registration request to session for later use\n  ...\n\n  // Send registration request to client\n  ...\n\n}, function(error) {\n  // Handle registration request error\n  ...\n\n});\n\n```\n\nWhere existingKeys is an array of token metadata for tokens already bound to the user account.  \n\nThe registration request object must be stored for use when validating the client response in the next step.  \n\nIt can then be used on the client with `u2f.register(req.appId, req.registerRequests, req.registeredKeys, registerCallback, req.timeoutSeconds);`.\n\nTo finalise device registration use:\n```\n// Process registration response\nu2f.finishRegistration(registrationRequest, reqistrationResponse)\n.then(function(registrationStatus) {\n  // Save device meta structure for future authentication use\n  var meta = {\n    keyHandle: registrationStatus.keyHandle, \n    publicKey: registrationStatus.publicKey,\n    certificate: registrationStatus.certificate\n  }\n  ...\n\n}, function(error) {\n  // Handle registration error\n  ...\n\n});\n\n\n```\n\n### Authentication\n\nTo start the authentication process call:\n```\n// Generate authentication request\nvar authRequest = u2f.startAuthentication(appId, existingKeys, {requestId: N, timeoutSeconds: 10});\n.then(function(registrationRequest) {\n  // Save authentication request to session for later use\n  ...\n\n  // Send authentication request to client\n  ...\n  \n}, function(error) {\n  // Handle authentication request error\n  ...\n\n});\n\n```\n\nWhere existingKeys is an array of token metadata for viable authentication tokens (those registered to the users account).  \n\nThis registration request object must be stored for use when validating the client authentication response in the next step.  \nIt can then be used on the client with `u2f.sign(req.appId, req.challenge, req.registeredKeys, signatureCallback, req.timeoutSeconds);`.\n\nTo finalise the authentication process call:\n```\n// Check authentication response\nu2f.finishAuthentication(signRequest, signResponse, deviceRegistration)\n.then(function(authenticationStatus) {\n  // Authentication ok!\n  ...\n\n}, function(error) {\n  // Handle authentication error\n  ...\n\n});\n\n```\n\nFor further examples, check out [test.js](./test.js).\n\nNotes\n-----\n\nThe high level client interface referred to above is defined as follows:\n```\ninterface u2f {\n    void register (DOMString appId, sequence<RegisterRequest> registerRequests, sequence<RegisteredKey> registeredKeys, function(RegisterResponse or Error) callback, optional unsigned long? opt_timeoutSeconds);\n    void sign (DOMString appId, DOMString challenge, sequence<RegisteredKey> registeredKeys, function(SignResponse or Error) callback, optional unsigned long? opt_timeoutSeconds);\n};\n```\n\n------\n\nIf you have any questions, comments, or suggestions, feel free to open an issue or a pull request.\n\n","maintainers":[{"name":"ryankurte","email":"ryankurte@gmail.com"}],"time":{"modified":"2022-06-13T03:47:37.880Z","created":"2016-06-22T05:25:00.565Z","0.0.2":"2016-06-22T05:25:00.565Z","0.1.0":"2016-06-27T12:10:25.668Z","0.1.1":"2016-06-28T08:45:07.979Z"},"homepage":"https://github.com/ryankurte/authdog","keywords":["u2f","server","library","2nd-factor","fido","auth","dog"],"repository":{"type":"git","url":"git+https://github.com/ryankurte/authdog.git"},"contributors":[{"name":"Emile Cantin"},{"name":"Jacob Marshall"}],"author":{"name":"Ryan Kurte"},"bugs":{"url":"https://github.com/ryankurte/authdog/issues"},"license":"MIT","readmeFilename":"README.md","users":{"ga1989":true}}