{"id":16981973,"url":"https://github.com/1602/compound-passport","last_synced_at":"2026-03-12T19:16:49.517Z","repository":{"id":2631417,"uuid":"3618959","full_name":"1602/compound-passport","owner":"1602","description":"PassportJS integrated with Compound","archived":false,"fork":false,"pushed_at":"2016-11-15T22:23:21.000Z","size":63,"stargazers_count":47,"open_issues_count":6,"forks_count":33,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-28T11:58:52.255Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1602.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-04T15:27:28.000Z","updated_at":"2023-12-19T22:04:36.000Z","dependencies_parsed_at":"2022-08-29T12:50:31.085Z","dependency_job_id":null,"html_url":"https://github.com/1602/compound-passport","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/1602/compound-passport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Fcompound-passport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Fcompound-passport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Fcompound-passport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Fcompound-passport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1602","download_url":"https://codeload.github.com/1602/compound-passport/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Fcompound-passport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30439658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-14T02:06:59.432Z","updated_at":"2026-03-12T19:16:49.500Z","avatar_url":"https://github.com/1602.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\n\n[PassportJS](http://passportjs.org) auth library integrated into CompoundJS. This package allows authentication without any extra coding - just configure and use.\n\n## Setup\n**Step 1:** Install dependencies\n\nAdd `compound-passport`, `passport`, and any providers used to your `package.json` and run `npm install`. Remember to add the used Passport Strategies to your `package.json`, e.g. `passport-facebook`, `passport-github`, etc. -- see [PassportJS providers](http://passportjs.org/guide/providers/).\n\n**Step 2:** Configure\n\nPut the following configuration in ```config/passport.yml```.\n```yaml\ndevelopment:\n  baseURL: 'http://localhost:3000/'\n  logoutURL: 'http://localhost:3000/auth/'\n  local: true\n  google: true\n  github:\n    clientID: \"a8578b8dc47834908338\"\n    secret: \"d8107d7cd75fc8ee1f12cf1f38b3aa065c3ec2ac\"\n  linkedin:\n    apiKey: \"3s708f1uys4x\"\n    secret: \"p3iBqlybJ5WNTINv\"\nproduction:\n  baseURL: 'http://node-js.ru/'\n  logoutURL: 'http://node-js.ru/admin/'\n  github:\n    clientID: \"....\"\n    secret: \"....\"\n```\n\nTo separate configuration from code simply use \"process.env\" directly in the configuration file:\n\n```yaml\ndevelopment:\n  baseURL: 'http://localhost:3000/'\n  logoutURL: 'http://localhost:3000/auth/'\n  local: true\n  google: true\n  github:\n    clientId: \"process.env.GITHUB_API_KEY\"\n    secret: \"process.env.GITHUB_API_SECRET\"\n  linkedin:\n    apiKey: \"process.env.LINKEDIN_API_KEY\"\n    secret: \"process.env.LINKEDIN_API_SECRET\"\nproduction:\n  baseURL: 'http://node-js.ru/'\n  logoutURL: 'http://node-js.ru/admin/'\n  github:\n    clientID: \"....\"\n    secret: \"....\"\n```\n\nThe module will then automatically read environment variables and use those.\n\n**Step 3:** Add module\n\nAdd module to ```config/autoload.js```:\n\n```javascript\nmodule.exports = function() {\n    return [require('compound-passport')];\n};\n```\n\n\n## Use\n\nAll authentication routes starts with `/auth/PROVIDERNAME`\nJust visit `/auth/google` to sign in with google:\n\n    \u003c% link_to('Sign in with google', '/auth/google') %\u003e\n    \u003c% link_to('Sign in with linkedin', '/auth/linkedin') %\u003e\n    \u003c% link_to('Sign in with github', '/auth/github') %\u003e\n\nCallback urls:\n\n- GitHub: `/auth/github/callback`\n- LinkedIn: `/auth/linkedin/callback`\n\nLogout:\n\nProvide by `logout()` function from `passportjs`, see [passportjs#logout](http://passportjs.org/guide/logout/).\n\nEasily configurable in config.yml file, just add logout redirection url (default is '/'):\n\n```yaml\nlogoutURL: '/auth/'\n```\n\nExample before filter (describe in your application controller):\n\n```javascript\nbefore(function requireManager() {\n    if (!session.passport.user) {\n        req.session.redirect = req.path;\n        redirect('/auth/linkedin');\n    } else {\n        User.find(session.passport.user, function (err, user) {\n            if (user \u0026\u0026 user.email === 'my.email@somehost.tld') {\n                req.user = user;\n                next();\n            } else {\n                flash('error', 'You have no permission to access this area');\n                redirect('/');\n            }\n        });\n    }\n});\n```\n\n## MIT License\n\n```text\nCopyright (C) 2012 by Anatoliy Chakkaev \u003cmail@anatoliy.in\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n```\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\n```text\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1602%2Fcompound-passport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1602%2Fcompound-passport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1602%2Fcompound-passport/lists"}