{"id":20797919,"url":"https://github.com/jbips/hapi-oidc","last_synced_at":"2025-05-06T18:44:53.767Z","repository":{"id":33110443,"uuid":"152101650","full_name":"JbIPS/hapi-oidc","owner":"JbIPS","description":"Hapi authentication strategy for OpenID Connect","archived":false,"fork":false,"pushed_at":"2024-03-07T18:18:02.000Z","size":155,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T13:43:12.100Z","etag":null,"topics":["authentication","hapi","hapi-plugin","openid-connect"],"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/JbIPS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-10-08T15:18:43.000Z","updated_at":"2023-05-16T09:14:50.000Z","dependencies_parsed_at":"2024-11-17T16:37:49.739Z","dependency_job_id":"b29035ef-c0b8-424a-b61b-5ec05db1b91d","html_url":"https://github.com/JbIPS/hapi-oidc","commit_stats":{"total_commits":18,"total_committers":5,"mean_commits":3.6,"dds":0.2777777777777778,"last_synced_commit":"7e8a7ce1d5cf7f09304b3a5512cb2ad5219d53da"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JbIPS%2Fhapi-oidc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JbIPS%2Fhapi-oidc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JbIPS%2Fhapi-oidc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JbIPS%2Fhapi-oidc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JbIPS","download_url":"https://codeload.github.com/JbIPS/hapi-oidc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252747807,"owners_count":21798202,"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":["authentication","hapi","hapi-plugin","openid-connect"],"created_at":"2024-11-17T16:35:55.313Z","updated_at":"2025-05-06T18:44:53.747Z","avatar_url":"https://github.com/JbIPS.png","language":"JavaScript","readme":"# Hapi-OIDC\n\nOpenID-Connect authentication plugin for [hapi](https://github.com/hapijs/hapi).\n\n## Configuration\n\nThis plugin needs some configuration to discover and connect to the OIDC server:\n* `discoverUrl`: The discovery URL of your OIDC server\n* `clientId`: Client ID given by your OIDC server\n* `clientSecret`: Client secret given by your OIDC server\n* `callbackUrl`: The full URL that the server will call after the authorization process\n* [`cookie`]: Name of the cookie that will held the authentication. Defaults to `hapi-oidc`\n\nAlternatively, you can manually setup your OIDC client by replacing the discover URL by:\n* `issuer`: URL of the issuer\n* `authorization`: Authorization endpoint\n* `token`: Token generation endpoint\n* `userinfo`: User infos endpoint\n* `jwks`: JWKS endpoint\n\nWhen registering the `oidc` scheme, you'll need to configure the [cookie settings](https://hapijs.com/api#server.state()) if defaults do not suits you:\n* `password`=uuid4(),\n* [`path`='/']\n* [`ttl`= 3600 * 1000]\n* [`encoding`='iron']\n* [`isSecure`=true],\n* [`clearInvalid`=true]\n\n## Example\n\n```javascript\nconst Hapi = require('hapi');\nconst uuid4 = require('uuid/v4');\nconst OIDC = require('hapi-oidc');\n\nconst routes = require('./routes');\n\nconst server = Hapi.server({\n  port: 3000,\n});\n\nconst init = async () =\u003e {\n  await server.register([\n    {\n      plugin: OIDC,\n      options: {\n        discoverUrl: 'https://oidc-server.com/oauth2/default',\n        clientId: 'XXXXXXXXXXXXXXX',\n        clientSecret: 'XXXXXXXXXXXXXXXXXXXXXX',\n        callbackUrl: 'https://my-server:3000/login_callback',\n      },\n    }\n  ]);\n\n  server.auth.strategy('oidc', 'oidc', {\n    password: uuid4(),\n  });\n\n  server.route(routes);\n  await server.start();\n  server.log(['info'], `Server running at: ${server.info.uri}`);\n};\n\ninit();\n\nmodule.exports = server;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbips%2Fhapi-oidc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbips%2Fhapi-oidc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbips%2Fhapi-oidc/lists"}