{"id":23711370,"url":"https://github.com/springrole/passport-civic","last_synced_at":"2025-10-25T06:08:18.002Z","repository":{"id":57319969,"uuid":"103582522","full_name":"SpringRole/passport-civic","owner":"SpringRole","description":null,"archived":false,"fork":false,"pushed_at":"2018-02-12T13:08:08.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-28T22:54:15.565Z","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/SpringRole.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":"2017-09-14T21:16:30.000Z","updated_at":"2019-12-28T01:36:51.000Z","dependencies_parsed_at":"2022-08-26T01:11:11.854Z","dependency_job_id":null,"html_url":"https://github.com/SpringRole/passport-civic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringRole%2Fpassport-civic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringRole%2Fpassport-civic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringRole%2Fpassport-civic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringRole%2Fpassport-civic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpringRole","download_url":"https://codeload.github.com/SpringRole/passport-civic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231907830,"owners_count":18444186,"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-12-30T19:49:27.713Z","updated_at":"2025-10-25T06:08:12.973Z","avatar_url":"https://github.com/SpringRole.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passport-civic\n\n[Passport](http://passportjs.org/) strategy for authenticating with [Civic](https://www.civic.com/)\n\nThis module lets you authenticate using Civic in your Node.js applications.\nBy plugging into Passport, Civic 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\n    $ npm install passport-civic\n\n## Usage\n\n#### Configure Strategy\n\nThe Civic authentication strategy authenticates users using a Civic\napp.  The strategy requires a `verify` callback, which\naccepts these credentials and calls `done` providing a user, as well as\n`options` specifying a appId, prvKey, and appSecret.\n\n    passport.use(new CivicStrategy({\n        appId: APP_ID,\n        prvKey: PRIVATE_KEY,\n        appSecret: \"Something-secret\"\n      },\n      function(profile, done) {\n        User.findOrCreate({ civicId: profile.userId }, function (err, user) {\n          return done(err, user);\n        });\n      }\n    ));\n\n#### Parameters\n\nThe verify callback can be supplied with the `request` object by setting\nthe `passReqToCallback` option to true, and changing callback arguments\naccordingly.\n\n    passport.use(new CivicStrategy({\n        appId: APP_ID,\n        prvKey: PRIVATE_KEY,\n        appSecret: \"Something-secret\"\n        passReqToCallback: true\n      },\n      function(req, profile, done) {\n        // request object is now first argument\n        // ...\n      }\n    ));\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'civic'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n    app.get('/auth/civic',\n      passport.authenticate('civic'));\n\n    app.get('/auth/civic',\n      passport.authenticate('civic', { failureRedirect: '/login' }),\n      function(req, res) {\n        // Successful authentication, redirect home.\n        res.redirect('/');\n      });\n\n## Credits\n\n  - [Vinay Agarwal](http://github.com/vinay035)\n  - [Kartik Mandaville](http://github.com/kar2905)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringrole%2Fpassport-civic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringrole%2Fpassport-civic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringrole%2Fpassport-civic/lists"}