{"id":17886629,"url":"https://github.com/holzmaster/passport-pr0gramm","last_synced_at":"2025-03-22T14:31:41.352Z","repository":{"id":183120007,"uuid":"669639364","full_name":"holzmaster/passport-pr0gramm","owner":"holzmaster","description":"pr0gramm oauth2 authentication strategy for passport.js","archived":false,"fork":false,"pushed_at":"2024-11-01T14:31:56.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T05:18:46.497Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holzmaster.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-23T00:13:40.000Z","updated_at":"2024-11-01T14:31:59.000Z","dependencies_parsed_at":"2023-10-01T16:38:21.740Z","dependency_job_id":"287999eb-e632-4ffe-a700-3aaf464ab9a2","html_url":"https://github.com/holzmaster/passport-pr0gramm","commit_stats":null,"previous_names":["holzmaster/passport-pr0gramm"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holzmaster%2Fpassport-pr0gramm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holzmaster%2Fpassport-pr0gramm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holzmaster%2Fpassport-pr0gramm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holzmaster%2Fpassport-pr0gramm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holzmaster","download_url":"https://codeload.github.com/holzmaster/passport-pr0gramm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244972152,"owners_count":20540930,"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-10-28T13:08:38.681Z","updated_at":"2025-03-22T14:31:41.037Z","avatar_url":"https://github.com/holzmaster.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passport-pr0gramm [![CI](https://github.com/holzmaster/passport-pr0gramm/actions/workflows/CI.yaml/badge.svg)](https://github.com/holzmaster/passport-pr0gramm/actions/workflows/CI.yaml)\n[Passport](https://github.com/jaredhanson/passport) strategy for authenticating\nwith [pr0gramm](http://pr0gramm.com) using the OAuth 2.0 API.\n\nThis module lets you authenticate using pr0gramm in your Node.js applications.\nBy plugging into Passport, pr0gramm 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## Install\n```\nnpm i passport-pr0gramm\n```\n\n## Usage\n\n#### Configure Strategy\nThe pr0gramm authentication strategy authenticates users using a pr0gramm\naccount and OAuth 2.0 tokens. The strategy requires a `verify` callback, which\naccepts these credentials and calls `done` providing a user, as well as\n`options` specifying a client ID, client secret, and callback URL.\n\n```javascript\npassport.use(new Pr0grammStrategy({\n    clientID: PR0GRAMM_CLIENT_ID,\n    clientSecret: PR0GRAMM_CLIENT_SECRET,\n    callbackURL: \"http://127.0.0.1:3000/auth/pr0gramm/callback\"\n  },\n  function(accessToken, refreshToken, profile, done) {\n    User.findOrCreate({ pr0grammId: profile.id }, function (err, user) {\n      return done(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\nUse `passport.authenticate()`, specifying the `\"pr0gramm\"` strategy, to authenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com) application:\n\n```javascript\napp.get(\"/auth/pr0gramm\", function(req, res, next){\n  passport.authenticate(\"pr0gramm\")(req, res, next);\n});\n\napp.get(\"/auth/pr0gramm/callback\", function(req, res, next){\n  passport.authenticate(\"pr0gramm\", {\n    successRedirect: \"/\",\n    failureRedirect: \"/login\"\n  })(req, res, next);\n});\n```\n\n## Credits\nBased on [passport-reddit](https://github.com/Slotos/passport-reddit).\n\n- [Jared Hanson](http://github.com/jaredhanson)\n- [Dmytro Soltys](http://github.com/slotos)\n- [Brian Partridge](http://github.com/bpartridge83)\n\n## License\n[The ISC License](http://opensource.org/licenses/MIT)\n\nOriginal work Copyright (c) 2012-2013 Jared Hanson \u003c[http://jaredhanson.net/](http://jaredhanson.net/)\u003e\nModified work Copyright (c) 2013 Dmytro Soltys \u003c[http://slotos.net/](http://slotos.net/)\u003e\nModified work Copyright (c) 2013 Brian Partridge \u003c[http://brianpartridge.com/](http://brianpartridge.com/)\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholzmaster%2Fpassport-pr0gramm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholzmaster%2Fpassport-pr0gramm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholzmaster%2Fpassport-pr0gramm/lists"}