{"id":28076693,"url":"https://github.com/jaredhanson/passport-windowslive","last_synced_at":"2025-07-30T03:09:23.888Z","repository":{"id":2091881,"uuid":"3032113","full_name":"jaredhanson/passport-windowslive","owner":"jaredhanson","description":"Windows Live authentication strategy for Passport and Node.js.","archived":false,"fork":false,"pushed_at":"2018-07-12T22:08:21.000Z","size":57,"stargazers_count":35,"open_issues_count":6,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-13T01:46:15.711Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredhanson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-22T05:47:42.000Z","updated_at":"2024-02-24T18:38:10.000Z","dependencies_parsed_at":"2022-08-26T01:10:38.021Z","dependency_job_id":null,"html_url":"https://github.com/jaredhanson/passport-windowslive","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-windowslive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-windowslive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-windowslive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-windowslive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredhanson","download_url":"https://codeload.github.com/jaredhanson/passport-windowslive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253856614,"owners_count":21974575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-13T01:46:22.148Z","updated_at":"2025-05-13T01:46:22.921Z","avatar_url":"https://github.com/jaredhanson.png","language":"JavaScript","funding_links":["https://paypal.me/jaredhanson"],"categories":[],"sub_categories":[],"readme":"# passport-windowslive\n\n[![Build](https://img.shields.io/travis/jaredhanson/passport-windowslive.svg)](https://travis-ci.org/jaredhanson/passport-windowslive)\n[![Coverage](https://img.shields.io/coveralls/jaredhanson/passport-windowslive.svg)](https://coveralls.io/r/jaredhanson/passport-windowslive)\n[![Quality](https://img.shields.io/codeclimate/github/jaredhanson/passport-windowslive.svg?label=quality)](https://codeclimate.com/github/jaredhanson/passport-windowslive)\n[![Dependencies](https://img.shields.io/david/jaredhanson/passport-windowslive.svg)](https://david-dm.org/jaredhanson/passport-windowslive)\n\n\n\n[Passport](https://github.com/jaredhanson/passport) strategy for authenticating\nwith [Microsoft](http://www.microsoft.com/) accounts (aka [Windows Live](http://www.live.com/))\nusing the OAuth 2.0 API.\n\nThis module lets you authenticate using Windows Live in your Node.js\napplications.  By plugging into Passport, Windows Live authentication can be\neasily and unobtrusively integrated into any application or framework that\nsupports [Connect](http://www.senchalabs.org/connect/)-style middleware,\nincluding [Express](http://expressjs.com/).\n\n## Install\n\n    $ npm install passport-windowslive\n\n## Usage\n\n#### Create an Application\n\nBefore using `passport-windowslive`, you must register an application with\nMicrosoft.  If you have not already done so, a new application can be created at\n[Live Connect app management](https://account.live.com/developers/applications/index).\nYour application will be issued a client ID and client secret, which need to be\nprovided to the strategy.  You will also need to configure a redirect URL which\nmatches the route in your application.\n\n#### Configure Strategy\n\nThe Windows Live authentication strategy authenticates users using a Windows\nLive account and OAuth 2.0 tokens.  The client ID and secret obtained when\ncreating an application are supplied as options when creating the strategy.  The\nstrategy also requires a `verify` callback, which receives the access token and\noptional refresh token, as well as `profile` which contains the authenticated\nuser's Windows Live profile.  The `verify` callback must call `cb` providing a\nuser to complete authentication.\n\n    passport.use(new WindowsLiveStrategy({\n        clientID: WINDOWS_LIVE_CLIENT_ID,\n        clientSecret: WINDOWS_LIVE_CLIENT_SECRET,\n        callbackURL: \"http://www.example.com/auth/windowslive/callback\"\n      },\n      function(accessToken, refreshToken, profile, cb) {\n        User.findOrCreate({ windowsliveId: profile.id }, function (err, user) {\n          return cb(err, user);\n        });\n      }\n    ));\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'windowslive'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n    app.get('/auth/windowslive',\n      passport.authenticate('windowslive', { scope: ['wl.signin', 'wl.basic'] }));\n\n    app.get('/auth/windowslive/callback', \n      passport.authenticate('windowslive', { failureRedirect: '/login' }),\n      function(req, res) {\n        // Successful authentication, redirect home.\n        res.redirect('/');\n      });\n\n## Examples\n\nDevelopers using the popular [Express](http://expressjs.com/) web framework can\nrefer to an [example](https://github.com/passport/express-4.x-facebook-example)\nas a starting point for their own web applications.  The example shows how to\nauthenticate users using Facebook.  However, because both Facebook and Windows\nLive use OAuth 2.0, the code is similar.  Simply replace references to Facebook\nwith corresponding references to Windows Live.\n\n## FAQ\n\n##### How do I obtain a refresh token?\n\nYour authentication request must include `wl.offline_access` as detailed in\n[scopes and permissions](https://msdn.microsoft.com/en-us/library/hh243646.aspx).\n\n```js\npassport.authenticate('windowslive', { scope: [ 'wl.offline_access' ] })\n```\n\n## Contributing\n\n#### Tests\n\nThe test suite is located in the `test/` directory.  All new features are\nexpected to have corresponding test cases.  Ensure that the complete test suite\npasses by executing:\n\n```bash\n$ make test\n```\n\n#### Coverage\n\nAll new feature development is expected to have test coverage.  Patches that\nincrese test coverage are happily accepted.  Coverage reports can be viewed by\nexecuting:\n\n```bash\n$ make test-cov\n$ make view-cov\n```\n\n## Support\n\n#### Funding\n\nThis software is provided to you as open source, free of charge.  The time and\neffort to develop and maintain this project is dedicated by [@jaredhanson](https://github.com/jaredhanson).\nIf you (or your employer) benefit from this project, please consider a financial\ncontribution.  Your contribution helps continue the efforts that produce this\nand other open source software.\n\nFunds are accepted via [PayPal](https://paypal.me/jaredhanson), [Venmo](https://venmo.com/jaredhanson),\nand [other](http://jaredhanson.net/pay) methods.  Any amount is appreciated.\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2011-2016 Jared Hanson \u003c[http://jaredhanson.net/](http://jaredhanson.net/)\u003e\n\n\u003ca target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-windowslive'\u003e  \u003cimg alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-windowslive.svg' /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredhanson%2Fpassport-windowslive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredhanson%2Fpassport-windowslive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredhanson%2Fpassport-windowslive/lists"}