{"id":20307349,"url":"https://github.com/oktadev/okta-nodejs-login-example","last_synced_at":"2025-06-27T23:32:57.148Z","repository":{"id":54391107,"uuid":"265624741","full_name":"oktadev/okta-nodejs-login-example","owner":"oktadev","description":"Node.js Login Example","archived":false,"fork":false,"pushed_at":"2021-02-21T11:11:13.000Z","size":255,"stargazers_count":6,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-11T15:14:47.229Z","etag":null,"topics":["authentication","express","login","node","nodejs"],"latest_commit_sha":null,"homepage":"https://developer.okta.com/blog/2020/06/16/nodejs-login","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oktadev.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}},"created_at":"2020-05-20T16:31:29.000Z","updated_at":"2023-12-19T14:34:42.000Z","dependencies_parsed_at":"2022-08-13T14:11:07.765Z","dependency_job_id":null,"html_url":"https://github.com/oktadev/okta-nodejs-login-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oktadev/okta-nodejs-login-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-nodejs-login-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-nodejs-login-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-nodejs-login-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-nodejs-login-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-nodejs-login-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-nodejs-login-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262351545,"owners_count":23297633,"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","express","login","node","nodejs"],"created_at":"2024-11-14T17:17:18.957Z","updated_at":"2025-06-27T23:32:57.107Z","avatar_url":"https://github.com/oktadev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js + Express Login Example\n\nThis example shows how to add Login to a Node.js application. Please read [Node.js Login with Express and OIDC](https://developer.okta.com/blog/2020/06/16/nodejs-login) to see how it was created.\n\n**Prerequisites:** \n\n* [Node 12](https://nodejs.org/)+\n\n\u003e [Okta](https://developer.okta.com/) has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage and secure users and roles in any application.\n\n* [Getting Started](#getting-started)\n* [Help](#help)\n* [Links](#links)\n* [License](#license)\n\n## Getting Started\n\nTo install this example application, run the following commands:\n\n```bash\ngit clone https://github.com/oktadeveloper/okta-nodejs-login-example.git\ncd okta-nodejs-login-example\nnpm install\n```\n\nThis will get a copy of the project locally. \n\n### Create a Free Okta Developer Account\n\nIf you don't have one, [create an Okta Developer account](https://developer.okta.com/signup/). After you've completed the setup process, log in to your account.\n\nCreate a new OIDC app by navigating to **Applications** \u003e **Add Application** \u003e select **Web**, and click **Next**. Fill in the following values:\n\n* Name: `Node.js Login`\n* Base URI: `http://localhost:3000`\n* Login redirect URI: `http://localhost:3000/callback`\n* Logout redirect URI: `http://localhost:3000`\n\nClick **Done** to create your app. \n\nCreate a `.env` file in your root directory and copy the client ID and secret into it. You can find the value for `\u003cYOUR_ISSUER\u003e` by navigating to **API** \u003e **Authorization Servers**.\n\n```\nOIDC_ISSUER=\u003cYOUR_ISSUER\u003e\nOIDC_CLIENT_ID=\u003cYOUR_CLIENT_ID\u003e\nOIDC_CLIENT_SECRET=\u003cYOUR_CLIENT_SECRET\u003e\nBASE_URL=http://localhost:3000\nSESSION_SECRET=todo: make-this-more-secure\n```\n   \n**NOTE**: Make sure to remove the `\u003c...\u003e` placeholders. Your issuer should look something like: `https://dev-123456.okta.com/oauth2/default`.\n\n### Start the application\n\nStart your application:\n\n```\nnpm start\n```\n\nLog in to `http://localhost:3000` and enjoy your login experience!\n\n## Links\n\nThis example uses the following libraries provided by Okta:\n\n* [OktaDev Schematics](https://github.com/oktadeveloper/schematics#readme)\n* [OIDC Middleware](https://github.com/okta/okta-oidc-js/tree/master/packages/oidc-middleware)\n\n## Help\n\nPlease post any questions as issues in this repo, or visit our [Okta Developer Forums](https://devforum.okta.com/). \n\n## License\n\nApache 2.0, see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-nodejs-login-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-nodejs-login-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-nodejs-login-example/lists"}