{"id":18315545,"url":"https://github.com/mathieutu/lvconnect-passport","last_synced_at":"2025-04-09T13:16:52.750Z","repository":{"id":48985437,"uuid":"165557658","full_name":"mathieutu/lvconnect-passport","owner":"mathieutu","description":"LVConnect authentication strategy for Passport and Node.js. ","archived":false,"fork":false,"pushed_at":"2021-07-02T04:17:05.000Z","size":298,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T07:20:23.297Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mathieutu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-13T21:42:18.000Z","updated_at":"2019-02-14T18:52:02.000Z","dependencies_parsed_at":"2022-09-04T07:42:00.653Z","dependency_job_id":null,"html_url":"https://github.com/mathieutu/lvconnect-passport","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flvconnect-passport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flvconnect-passport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flvconnect-passport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flvconnect-passport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathieutu","download_url":"https://codeload.github.com/mathieutu/lvconnect-passport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045267,"owners_count":21038555,"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":"2024-11-05T16:41:32.014Z","updated_at":"2025-04-09T13:16:52.723Z","avatar_url":"https://github.com/mathieutu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LVConnect Passport\n \n[Passport](http://passportjs.org/) strategy for authenticating with [LVConnect](https://gitlab.com/LinkValue/Lab/LVConnect/LvConnect)\nusing the OAuth 2.0 API.\n\nThis module lets you authenticate using LVConnect in your Node.js applications.\nBy plugging into Passport, LVConnect authentication can be easily and\nunobtrusively integrated into any application or framework that supports\n[Connect](http://www.senchalabs.org/connect/)-style middleware, including\n[Express](http://expressjs.com/).\n\n[Linkvalue](https://link-value.fr) is a french web/mobile agency.\n\n**This package is an internal tool. You can download it and use it as an example for making your own, but it will be unusable if you're not a Linkvalue partner.**\n\n## Install\n\n```bash\n$ npm install lvconnect-passport\n```\n\n## Usage\n\n#### Create an Application\n\nBefore using `lvconnect-passport`, you must register an application with LVConnect.\nIf you have not already done so, a new application can be created at\n[developer applications](https://lvconnect.com/settings/applications/new) within\nLVConnect's settings panel.  Your application will be issued a client ID and client\nsecret, which need to be provided to the strategy.  You will also need to\nconfigure a callback URL which matches the route in your application.\n\n#### Configure Strategy\n\nThe LVConnect authentication strategy authenticates users using a LVConnect account\nand OAuth 2.0 tokens.  The client ID and secret obtained when creating an\napplication are supplied as options when creating the strategy.  The strategy\nalso requires a `verify` callback, which receives the access token and optional\nrefresh token, as well as `profile` which contains the authenticated user's\nLVConnect profile.  The `verify` callback must call `cb` providing a user to\ncomplete authentication.\n\n```js\nconst LVConnectStrategy = require('lvconnect-passport');\n\npassport.use(new LVConnectStrategy({\n    clientID: LVCONNECT_CLIENT_ID,\n    clientSecret: LVCONNECT_CLIENT_SECRET,\n    callbackURL: \"/auth/lvconnect/callback\"\n  },\n  function(accessToken, refreshToken, profile, done) {\n    User.findOrCreate({ lVConnectId: profile.id }, function (err, user) {\n      return done(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'lvconnect'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```js\napp.get('/auth/lvconnect',\n  passport.authenticate('lvconnect'));\n\napp.get('/auth/lvconnect/callback', \n  passport.authenticate('lvconnect', { failureRedirect: '/login' }),\n  function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect('/');\n  });\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 LVConnect\nuse OAuth 2.0, the code is similar.  Simply replace references to Facebook with\ncorresponding references to LVConnect.\n\n## License\n\nThis LVConnect Passport package is an open-sourced software licensed under the MIT license.\n\n## Contributing\n\nIssues and PRs are obviously welcomed and encouraged, for new features as well as documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieutu%2Flvconnect-passport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieutu%2Flvconnect-passport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieutu%2Flvconnect-passport/lists"}