{"id":21031291,"url":"https://github.com/workable/passport-indeed-oauth2","last_synced_at":"2025-06-12T20:04:51.201Z","repository":{"id":61838937,"uuid":"413738089","full_name":"Workable/passport-indeed-oauth2","owner":"Workable","description":"Passport strategies for authenticating with Indeed using ONLY OAuth 2.0.","archived":false,"fork":false,"pushed_at":"2024-04-15T15:02:20.000Z","size":308,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-02T23:15:15.688Z","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/Workable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-10-05T08:41:38.000Z","updated_at":"2022-10-20T11:16:19.000Z","dependencies_parsed_at":"2024-10-09T09:55:50.348Z","dependency_job_id":null,"html_url":"https://github.com/Workable/passport-indeed-oauth2","commit_stats":{"total_commits":10,"total_committers":4,"mean_commits":2.5,"dds":0.6,"last_synced_commit":"8a4aa3bee260825646801f9eaa66ae341ed7e717"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Workable/passport-indeed-oauth2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Fpassport-indeed-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Fpassport-indeed-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Fpassport-indeed-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Fpassport-indeed-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Workable","download_url":"https://codeload.github.com/Workable/passport-indeed-oauth2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Fpassport-indeed-oauth2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259521512,"owners_count":22870448,"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-19T12:27:05.900Z","updated_at":"2025-06-12T20:04:51.162Z","avatar_url":"https://github.com/Workable.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passport-indeed-oauth2\n\n[Passport](http://passportjs.org/) strategy implemeting Indeed's Oauth2 authentication.  \nThis module supports custom functionality like retrieving the user profile from Indeed\nand provides helpers in order to implement Indeed's \"Represent an employer\" flow.\n\n\n## Installation\n\n```bash\n$ npm install passport-indeed-oauth2\n```\n\n## Usage\n\n#### Basic Usage\n\nBasic usage matches usage of:\nhttps://github.com/jaredhanson/passport-oauth2\n\nIt is assumed that you have already registed a new OAuth 2.0 application with Indeed on:  \nhttps://secure.indeed.com/account/apikeys/register  \nThose credentials should be supplied as options when initialising the strategy as `clientId` and `clientSecret`\n\nThe default URLs to authorize are already contained in the strategy and shouldn't have to be overriden:  \nauthorizationURL: https://secure.indeed.com/oauth/v2/authorize  \ntokenURL: https://apis.indeed.com/oauth/v2/tokens  \nprofileUrl: https://secure.indeed.com/v2/api/userinfo  \n\nExample:\n\n```javascript\npassport.use(new IndeedStrategy({\n    clientId: INDEED_CLIENT_ID,\n    clientSecret: INDEED_CLIENT_SECRET,\n    callbackURL: \"http://yourapp.io/auth/indeed/callback\",\n    passReqToCallback: true\n  },\n  function(request, accessToken, refreshToken, profile, done) {\n    // profile follows the same structure as: https://developer.indeed.com/docs/authorization/3-legged-oauth#user-info\n    User.findOrCreate({ indeed_id: profile.sub }, function (err, user) {\n      return cb(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'indeed'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```javascript\napp.get('/auth/indeed',\n  passport.authenticate('indeed'));\n\napp.get('/auth/indeed/callback',\n  passport.authenticate('indeed', { failureRedirect: '/login' }),\n  function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect('/');\n  });\n```\n\n#### Representing an employer\nWhen redirecting the user to Indeed you can add the `\u0026prompt=select_employer` query param which will prompt the user to select their employer.  \nWhen Indeed redirects back to your `callbackURL`, it will include the id of the employer that the user has selected as an `employer` query param.  \nPass this `employer` param as an option to the `passport.authenticate` call and the strategy will add it as a param to the body of the request made in order to retrieve the token.  \nThe resulting token will have the ability to \"represent an employer\"\n  \nIndeed should be the point of contact regarding updated documentation and details regarding this flow.\nThat said here are some tips for the implementor that are valid at the time:\n\n* Indeed requires that you also include this param when *refreshing* a token, if you also want your new token to represent an employer.\nFor this case you can access the employer id of a specific token by JWT decoding it, and accessing the field in this fashion:\n`const employerId = JWT.decode(token).payload.emp;`\n\n* Indeed does not guarantee that an employer id will be returned when the `select_employer` prompt is used.\nIf this user is not part of any employer accounts they can proceed without selecting an employer.\nIf representing an employer is required for the flow you're trying to implement, your application must handle this lack of employer id and present the user with a releavant error asking that they join an employer account and reauthenticate in order to proceed.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkable%2Fpassport-indeed-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkable%2Fpassport-indeed-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkable%2Fpassport-indeed-oauth2/lists"}