{"id":16254294,"url":"https://github.com/celer/hopjs-oauth","last_synced_at":"2025-07-02T03:05:24.126Z","repository":{"id":6484667,"uuid":"7724957","full_name":"celer/hopjs-oauth","owner":"celer","description":"OAuth support for HopJS","archived":false,"fork":false,"pushed_at":"2013-01-22T08:36:52.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T09:45:28.996Z","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/celer.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":"2013-01-21T02:17:07.000Z","updated_at":"2013-12-06T06:57:39.000Z","dependencies_parsed_at":"2022-09-11T13:31:58.196Z","dependency_job_id":null,"html_url":"https://github.com/celer/hopjs-oauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/celer/hopjs-oauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celer%2Fhopjs-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celer%2Fhopjs-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celer%2Fhopjs-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celer%2Fhopjs-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/celer","download_url":"https://codeload.github.com/celer/hopjs-oauth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celer%2Fhopjs-oauth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263066555,"owners_count":23408387,"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-10T15:21:01.550Z","updated_at":"2025-07-02T03:05:24.103Z","avatar_url":"https://github.com/celer.png","language":"JavaScript","readme":"# Introduction\n\nThis is the oauth plugin for Hop.js (http://github.com/celer/hopjs)\n\nTo use this plugin simply use it like so\n\n```javascript\n\nvar Hop = require('hopjs');\n\nHop.use(require('hopjs-oauth'));\n\n//This function when provided with a user object will return the id of the user\nvar getUserId=function(){ ...}\n\nvar provider = Hop.useOAuth({ \n\tcrypt_key:\"foo\",\n\tsign_key:\"bar\",\n\tloginURL: \"/login\",\t\n\tgrantStore: new Hop.RedisGrantStore({ redisClient: redisClient, getUserId: getUserId }),\n\taccessToken:function(req,token,next){\n\t\tconsole.log(\"Access token request\",token);\n\t\t\n\t\tloadUserById(token.user_id, function(err,user){\n\t\t\tif(user){\n\t\t\t\treq.session.user=user;\n\t\t\t\tnext();\n\t\t\t} else {\n\t\t\t\tnext(new Error(\"Unable to load user\"));\n\t\t\t}\n\t\t});\n\t}\n});\n\n\nvar app = express();\napp.configure(function(){\n  app.set('port', process.env.PORT || 3000);\n  app.set('views', __dirname + '/views');\n  app.set('view engine', 'jade');\n  app.use(express.bodyParser());\n  app.use(express.methodOverride());\n  app.use(express.cookieParser('your secret here'));\n  app.use(express.session());\n\tapp.use(provider.oauth());\n\tapp.use(provider.login());\n  app.use(app.router);\n  app.use(express.static(path.join(__dirname, 'public')));\n});\n\n```\n\nSee http://github.com/celer/hopjs-oauth/tree/master/examples/provider and http://github.com/celer/hopjs-oauth/tree/master/examples/consumer for working examples\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceler%2Fhopjs-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceler%2Fhopjs-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceler%2Fhopjs-oauth/lists"}