{"_id":"vsts-device-flow-auth","_rev":"30-21825d5976542f0516b58b9c7dd630a9","name":"vsts-device-flow-auth","dist-tags":{"latest":"1.136.0"},"versions":{"0.0.1":{"name":"vsts-device-flow-auth","version":"0.0.1","keywords":["vsts","visual studio team services","device flow","authentication"],"author":"","license":"SEE LICENSE IN LICENSE.txt","_id":"vsts-device-flow-auth@0.0.1","maintainers":[{"name":"vsonline","email":"vsonline"}],"homepage":"https://github.com/Microsoft/vsts-device-flow-auth/blob/master/README.md","bugs":{"url":"https://github.com/Microsoft/vsts-device-flow-auth/issues"},"dist":{"shasum":"db27329d33b7c495aec1bb46418eafa0091dfb96","tarball":"https://registry.npmjs.org/vsts-device-flow-auth/-/vsts-device-flow-auth-0.0.1.tgz","integrity":"sha512-aufKMaPMh4FOJfodNKuU4W5opOixYQ5cqxz0DRKFL48hqoyFd3WHzaRv3McAZoRE8pI5ysOOHQd22EJS59X33Q==","signatures":[{"sig":"MEUCIEaeAf4NJkInYh2PbYTsc3L0v+jgD0djl6cFgyya30VHAiEA5OUBFFXxnsT/DzxLRVIhO3ZBf0U0GXycfynhLae3+Gg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"out/src/deviceflow.js","_from":".","_shasum":"db27329d33b7c495aec1bb46418eafa0091dfb96","engines":{"node":">=0.12.0"},"gitHead":"85713bc25322f2b2cf09affe828e5530fe8a38aa","scripts":{},"_npmUser":{"name":"vsonline","email":"bigbldt@microsoft.com"},"repository":{"url":"git+https://github.com/Microsoft/vsts-device-flow-auth.git","type":"git"},"_npmVersion":"4.2.0","description":"Device Flow authentication package for Visual Studio Team Services","directories":{},"_nodeVersion":"7.10.0","dependencies":{"request":"^2.81.0","request-promise-native":"^1.0.4"},"devDependencies":{"del":"^3.0.0","gulp":"^3.9.1","tslint":"^5.4.3","gulp-util":"^3.0.8","typescript":"^2.3.4","@types/node":"^7.0.31","gulp-tslint":"^8.1.1","@types/request":"0.0.44","gulp-typescript":"^3.1.7","@types/request-promise-native":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/vsts-device-flow-auth-0.0.1.tgz_1499803526683_0.8948387987911701","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"vsts-device-flow-auth","version":"0.0.2","keywords":["vsts","visual studio team services","device flow","authentication"],"author":"","license":"SEE LICENSE IN LICENSE.txt","_id":"vsts-device-flow-auth@0.0.2","maintainers":[{"name":"vsonline","email":"bigbldt@microsoft.com"}],"homepage":"https://github.com/Microsoft/vsts-device-flow-auth/blob/master/README.md","bugs":{"url":"https://github.com/Microsoft/vsts-device-flow-auth/issues"},"dist":{"shasum":"e55bf5fd0088c0c9b5da9c2c72251d76b2831944","tarball":"https://registry.npmjs.org/vsts-device-flow-auth/-/vsts-device-flow-auth-0.0.2.tgz","integrity":"sha512-LuU6pwi44WJHwdgbKiXHgdH2gaUpvMlpWmpjy/8tSx1Fu7wYRhSgOs1T0qUG3DrfDi5ZoeO5uA8JMQMxwCMkbQ==","signatures":[{"sig":"MEUCIQCNoieKrs1rdieDGdDEihvherpcLGeRs5zpF4Ya6xqeJQIgTMzjW/et+28K6Y+4lidyEw9RAiVIK43l6IYL9obXMzk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"out/src/deviceflow.js","_from":".","_shasum":"e55bf5fd0088c0c9b5da9c2c72251d76b2831944","engines":{"node":">=0.12.0"},"gitHead":"32e38ad8b7a5dd49d5eb7f99db209c5aaae43819","scripts":{},"_npmUser":{"name":"vsonline","email":"bigbldt@microsoft.com"},"repository":{"url":"git+https://github.com/Microsoft/vsts-device-flow-auth.git","type":"git"},"_npmVersion":"4.2.0","description":"Device Flow authentication package for Visual Studio Team Services","directories":{},"_nodeVersion":"7.10.0","dependencies":{"request":"^2.81.0","request-promise-native":"^1.0.4"},"devDependencies":{"del":"^3.0.0","gulp":"^3.9.1","tslint":"^5.4.3","gulp-util":"^3.0.8","typescript":"^2.3.4","@types/node":"^7.0.31","gulp-tslint":"^8.1.1","@types/request":"0.0.44","gulp-typescript":"^3.1.7","@types/request-promise-native":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/vsts-device-flow-auth-0.0.2.tgz_1499806397165_0.42533211200498044","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"vsts-device-flow-auth","version":"0.0.3","keywords":["vsts","visual studio team services","device flow","authentication"],"author":"","license":"SEE LICENSE IN LICENSE.txt","_id":"vsts-device-flow-auth@0.0.3","maintainers":[{"name":"vsonline","email":"bigbldt@microsoft.com"}],"homepage":"https://github.com/Microsoft/vsts-device-flow-auth/blob/master/README.md","bugs":{"url":"https://github.com/Microsoft/vsts-device-flow-auth/issues"},"dist":{"shasum":"b059863d92619c6005953576b51ce1341d7b6e19","tarball":"https://registry.npmjs.org/vsts-device-flow-auth/-/vsts-device-flow-auth-0.0.3.tgz","integrity":"sha512-33mrBs74sf4jz3nsGRgWCMWC11ZZwcz+Fh2Khyz/vzjtm6mmKFzJd8LfmBs4oPhDvxISYieHdGew02YF+xa0Pw==","signatures":[{"sig":"MEUCIQCGYO7dZcPW2R8V4604Q3CH9SzT51chFe93Jh8VXfifSQIgK2cLRC6QLfgb1lgCfemYxT7xvHMP5F39RIe1xXQHnPo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"out/src/deviceflow.js","_from":".","_shasum":"b059863d92619c6005953576b51ce1341d7b6e19","engines":{"node":">=0.12.0"},"gitHead":"b33d0741ec321e74d229f1cb78821040219f750a","scripts":{},"typings":"out/src/deviceflow.d.ts","_npmUser":{"name":"vsonline","email":"bigbldt@microsoft.com"},"repository":{"url":"git+https://github.com/Microsoft/vsts-device-flow-auth.git","type":"git"},"_npmVersion":"4.2.0","description":"Device Flow authentication package for Visual Studio Team Services","directories":{},"_nodeVersion":"7.10.0","dependencies":{"request":"^2.81.0","request-promise-native":"^1.0.4"},"devDependencies":{"del":"^3.0.0","gulp":"^3.9.1","merge2":"^1.1.0","tslint":"^5.4.3","gulp-util":"^3.0.8","typescript":"^2.3.4","@types/node":"^7.0.31","gulp-tslint":"^8.1.1","@types/request":"0.0.44","gulp-typescript":"^3.1.7","@types/request-promise-native":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/vsts-device-flow-auth-0.0.3.tgz_1499809660858_0.4069971926510334","host":"s3://npm-registry-packages"}},"1.121.0":{"name":"vsts-device-flow-auth","version":"1.121.0","keywords":["vsts","visual studio team services","device flow","authentication"],"author":"","license":"SEE LICENSE IN LICENSE.txt","_id":"vsts-device-flow-auth@1.121.0","maintainers":[{"name":"vsonline","email":"bigbldt@microsoft.com"}],"homepage":"https://github.com/Microsoft/vsts-device-flow-auth/blob/master/README.md","bugs":{"url":"https://github.com/Microsoft/vsts-device-flow-auth/issues"},"dist":{"shasum":"bc0eb17264d734fb4ad00f760be157f186d3fde8","tarball":"https://registry.npmjs.org/vsts-device-flow-auth/-/vsts-device-flow-auth-1.121.0.tgz","integrity":"sha512-zWX23vq4ud2x5hoJ0T1yMvL5z++bdqQJl3V6qLIIjMk3B7jrUf8BbQEXleWwdtvvJR6lTVwccSlIMuSZ0vonIA==","signatures":[{"sig":"MEQCIB9DK60sowWN3MpQKhXegqdR8rPLwaJthp0CMJsaJOjZAiBrRuS1E2sQ1eQzz+HZ5CPkZtxpOQ55mB7Zk3pSzjnUpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"out/src/deviceflow.js","_from":".","_shasum":"bc0eb17264d734fb4ad00f760be157f186d3fde8","engines":{"node":">=0.12.0"},"gitHead":"6a8f80de5ca3db3d589d9785cc39437630de54f2","scripts":{},"typings":"out/src/deviceflow.d.ts","_npmUser":{"name":"vsonline","email":"bigbldt@microsoft.com"},"repository":{"url":"git+https://github.com/Microsoft/vsts-device-flow-auth.git","type":"git"},"_npmVersion":"4.2.0","description":"Device Flow authentication package for Visual Studio Team Services","directories":{},"_nodeVersion":"7.10.0","dependencies":{"request":"^2.81.0","request-promise-native":"^1.0.4"},"devDependencies":{"del":"^3.0.0","gulp":"^3.9.1","merge2":"^1.1.0","tslint":"^5.4.3","gulp-util":"^3.0.8","typescript":"^2.3.4","@types/node":"^7.0.31","gulp-tslint":"^8.1.1","@types/request":"0.0.44","gulp-typescript":"^3.1.7","@types/request-promise-native":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/vsts-device-flow-auth-1.121.0.tgz_1499888371624_0.921911396086216","host":"s3://npm-registry-packages"}},"1.136.0":{"name":"vsts-device-flow-auth","version":"1.136.0","keywords":["vsts","visual studio team services","device flow","authentication"],"author":"","license":"SEE LICENSE IN LICENSE.txt","_id":"vsts-device-flow-auth@1.136.0","maintainers":[{"name":"vsonline","email":"bigbldt@microsoft.com"}],"homepage":"https://github.com/Microsoft/vsts-device-flow-auth/blob/master/README.md","bugs":{"url":"https://github.com/Microsoft/vsts-device-flow-auth/issues"},"dist":{"shasum":"23aa80b0cf840e9895b221d302c9c4c93a5cfb06","tarball":"https://registry.npmjs.org/vsts-device-flow-auth/-/vsts-device-flow-auth-1.136.0.tgz","fileCount":6,"integrity":"sha512-nL/dMJC+uLBweCb8q8KJzPL8/4hhwAOlfNAGRgPfMpFNKCiEktrNxdtY3J4Zq/usBPPlgEf5My+dzDvRsQPNmg==","signatures":[{"sig":"MEUCIDUdXw19g/Irj4FCw8qofpaOsUSGOHdmqiGNGF2xIOLgAiEAwrVrtMOAggl4YQwSkb8bXmjMGehLCmucVCcVqzHyIxo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBGweCRA9TVsSAnZWagAAn18P/1Zt3TKj3hp2kbFv+8Kg\nSp0uwz3oM/4S89FD5iwUQCgpQuK+EjrXzFIqQbjeI6F6WqJxzrloplV5BV5f\n8y33IILPfAxMkJf7EpDuaP9hTvRU0WP5j+C/rDTNGddKC8d7dX+V1jYXlrcv\nJXer2oYfBIsndtGXAB1aV4AvEy6KKE/ypVqIgrXBb958wmwLLT1p8Gcj8j6O\nejlv906kqQeVMmSJaCX7wQ2T57GjgOnSPyUTd+quNWEqsnh4Ew+xpsb0nlGf\n0gH8V5sKso3VjcRNvbMAprBvcJt1QVQhllfF9EcZoYkQL0D1FBz6+Ddy3avc\n2a/+k4YnsYPTrT+P55Nq7eY1wrO9unim7u8Xh+6WYT32hfFHkmOYL7tWxnyR\nQJnAeYcg9SMf2JRJwbdCYNdLhSrhkQGaK3wl+ptE2lX1lEM6wjB2eSB2f5C4\nbbOXHLhnoLez2pq1N+mBAr0Ng28eMVqw/ciYt4wYhBuLnx/81mQLxt00boDx\nXeLldb866mAhthMTKcqhhyDIIhAacrHVfUcwnCqlcVJLHKcx8kRaLVY5o5NM\njZ16ifqlxMcm8v/h48FYxzsRGt4jPkNlrgs+kY3m3UcmSiN8zWI5ANvdDWJr\nMqD18lV9SU0S1th3pfIEZN5ELUxMJSRJP46ps4/rJQ8jKWBqWoL73jy/xT6G\nvZgd\r\n=4uO9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"out/src/deviceflow.js","engines":{"node":">=0.12.0"},"gitHead":"68946fa78da1dc7752c455a378c5441bfa307a16","scripts":{},"typings":"out/src/deviceflow.d.ts","_npmUser":{"name":"vsonline","email":"bigbldt@microsoft.com"},"repository":{"url":"git+https://github.com/Microsoft/vsts-device-flow-auth.git","type":"git"},"_npmVersion":"5.6.0","description":"Device Flow authentication package for Visual Studio Team Services","directories":{},"_nodeVersion":"8.9.4","dependencies":{"request":"^2.81.0","request-promise-native":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"del":"^3.0.0","gulp":"^3.9.1","merge2":"^1.1.0","tslint":"^5.4.3","gulp-util":"^3.0.8","typescript":"^2.3.4","@types/node":"^10.1.2","gulp-tslint":"^8.1.1","@types/request":"^2.47.0","gulp-typescript":"^3.1.7","@types/request-promise-native":"^1.0.14"},"_npmOperationalInternal":{"tmp":"tmp/vsts-device-flow-auth_1.136.0_1527016477504_0.5092183647956201","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-07-11T20:05:27.681Z","modified":"2026-08-27T06:51:14.530Z","0.0.1":"2017-07-11T20:05:27.681Z","0.0.2":"2017-07-11T20:53:18.059Z","0.0.3":"2017-07-11T21:47:41.878Z","1.121.0":"2017-07-12T19:39:32.523Z","1.136.0":"2018-05-22T19:14:37.811Z"},"bugs":{"url":"https://github.com/Microsoft/vsts-device-flow-auth/issues"},"license":"SEE LICENSE IN LICENSE.txt","homepage":"https://github.com/Microsoft/vsts-device-flow-auth/blob/master/README.md","keywords":["vsts","visual studio team services","device flow","authentication"],"repository":{"url":"git+https://github.com/Microsoft/vsts-device-flow-auth.git","type":"git"},"description":"Device Flow authentication package for Visual Studio Team Services","maintainers":[{"email":"npmvsts@microsoft.com","name":"vsonline"},{"email":"martinmrazik@microsoft.com","name":"martinmrazik"},{"email":"bojansmid@microsoft.com","name":"bsmid"},{"email":"edergachev@microsoft.com","name":"edergachev"},{"email":"tkasparek@microsoft.com","name":"tkasparek_ms"},{"email":"tramsing@microsoft.com","name":"tramsing"},{"email":"razvanmanole@microsoft.com","name":"razvanmanole"},{"email":"npmjs@microsoft.com","name":"microsoft1es"}],"readme":"# Visual Studio Team Services Device Flow Authentication for Node.js\r\n\r\n**vsts-device-flow-auth** is a small library that helps your Node.js application's users interactively authenticate to Visual Studio Team Services. It\r\nsupports both Azure Active Directory-backed (AAD) and Microsoft Account-backed (MSA) Team Services accounts. When the authentication is complete,\r\nthe Node.js application receives a personal access token to use on the Team Services user's behalf.\r\n\r\nInstall\r\n------------\r\n```\r\n$ npm install --save vsts-device-flow-auth\r\n```\r\n\r\nUsage\r\n------------\r\n\r\nCreate a `DeviceFlowAuthenticator` with the URI of the user's Team Services account. You will also need to provide your application's client id and redirect Uri. For\r\ninformation on how to register an application with Azure, see [How to register an app with the v2.0 endpoint](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-app-registration)\r\nfor details.\r\n```ts\r\nconst authOptions: IDeviceFlowAuthenticationOptions = {\r\n    clientId: '00000000-0000-0000-0000-000000000000',\r\n    redirectUri: 'https://some-url.com'\r\n};\r\nconst dfa: DeviceFlowAuthenticator = new DeviceFlowAuthenticator(\"https://my-corporate-account.visualstudio.com\", authOptions);\r\n```\r\n\r\nCall `GetDeviceFlowDetails()` to acquire the device_code, verification_url and optional message for the user to authenticate with Team Services.\r\n```ts\r\nconst obj: DeviceFlowDetails = await dfa.GetDeviceFlowDetails();\r\n```\r\n\r\nCall `WaitForPersonalAccessToken()` to get the token to use on the user's behalf.\r\n```ts\r\nconst pat: string = await dfa.WaitForPersonalAccessToken();\r\n```\r\n\r\nBelow is a short TypeScript example of how to use the package. A [complete example](https://www.github.com/Microsoft/vsts-device-flow-auth/blob/master/test-integration/testapp.ts) can be found in the GitHub repository.\r\n\r\n\r\n```ts\r\nimport { DeviceFlowAuthenticator, DeviceFlowDetails, IDeviceFlowAuthenticationOptions, IDeviceFlowTokenOptions } from 'vsts-device-flow-auth';\r\n\r\nasync function run() {\r\n    const resourceUri: string = `https://my-corporate-account.visualstudio.com`;\r\n    //const resourceUri: string = `https://my-personal-account.visualstudio.com`;\r\n\r\n    const authOptions: IDeviceFlowAuthenticationOptions = {\r\n        clientId: '00000000-0000-0000-0000-000000000000',\r\n        redirectUri: 'https://some-url.com'\r\n    };\r\n    const tokenOptions: IDeviceFlowTokenOptions = {\r\n        tokenDescription: `vsts-device-flow-auth test app: ${resourceUri} on ${os.hostname()}`,\r\n    };\r\n    const dfa: DeviceFlowAuthenticator = new DeviceFlowAuthenticator(resourceUri, authOptions, tokenOptions);\r\n\r\n    const obj: DeviceFlowDetails = await dfa.GetDeviceFlowDetails();\r\n    console.log(`message: ${obj.Message}`);\r\n    console.log(`user code: ${obj.UserCode}`);\r\n    console.log(`verify url: ${obj.VerificationUrl}`);\r\n\r\n    console.log(`Go do the Device Flow authentication...`);\r\n    console.log(``);\r\n\r\n    const pat: string = await dfa.WaitForPersonalAccessToken();\r\n    console.log(pat);\r\n}\r\n\r\nrun();\r\n```\r\n\r\n## Support\r\nSupport for this project is provided on our [GitHub Issue Tracker](https://github.com/Microsoft/vsts-device-flow-auth/issues). You\r\ncan submit a [bug report](https://github.com/Microsoft/vsts-device-flow-auth/issues/new), a [feature request](https://github.com/Microsoft/vsts-device-flow-auth/issues/new) or participate in [discussions](https://github.com/Microsoft/vsts-device-flow-auth/issues).\r\n\r\n## Contributing\r\nTo contribute to this project, see the [Contributing Guide](CONTRIBUTING.md).\r\n\r\n## Code of Conduct\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n\r\n## Privacy Statement\r\nThe [Microsoft Visual Studio Product Family Privacy Statement](http://go.microsoft.com/fwlink/?LinkId=528096&clcid=0x409)\r\ndescribes the privacy statement of this software.\r\n\r\n## License\r\nThis extension is [licensed under the MIT License](LICENSE.txt). Please see the [third-party notices](ThirdPartyNotices.txt)\r\nfile for additional copyright notices and license terms applicable to portions of the software.\r\n","readmeFilename":"README.md"}