{"id":20307279,"url":"https://github.com/oktadev/okta-socket-io-chat-example","last_synced_at":"2025-07-19T22:03:07.482Z","repository":{"id":45397169,"uuid":"381484607","full_name":"oktadev/okta-socket-io-chat-example","owner":"oktadev","description":"A simple chat application based on Socket.IO, React, and Express.","archived":false,"fork":false,"pushed_at":"2021-12-15T21:25:20.000Z","size":641,"stargazers_count":14,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T15:51:51.289Z","etag":null,"topics":["express","nodejs","react","socket-io","websockets"],"latest_commit_sha":null,"homepage":"https://developer.okta.com/blog/2021/07/14/socket-io-react-tutorial","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"holgerschmitz/socket-io-chat","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":"2021-06-29T20:08:02.000Z","updated_at":"2023-06-03T20:09:29.000Z","dependencies_parsed_at":"2022-10-24T10:15:24.088Z","dependency_job_id":null,"html_url":"https://github.com/oktadev/okta-socket-io-chat-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oktadev/okta-socket-io-chat-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-socket-io-chat-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-socket-io-chat-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-socket-io-chat-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-socket-io-chat-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-socket-io-chat-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-socket-io-chat-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266026162,"owners_count":23866030,"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":["express","nodejs","react","socket-io","websockets"],"created_at":"2024-11-14T17:17:01.394Z","updated_at":"2025-07-19T22:03:07.424Z","avatar_url":"https://github.com/oktadev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socket.IO with Express and React Example\n\nThis repository shows you how to integrate Express.js, React, and Socket.IO to create a secure chat application. Please read [Create a Secure Chat Application with Socket.IO and React][blog] to see how it was created.\n\n**Prerequisites:**\n\n- [Node 14](https://nodejs.org/)\n- [Okta CLI](https://github.com/okta/okta-cli)\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* [Links](#links)\n* [Help](#help)\n* [License](#license)\n\n## Getting Started\n\nTo run this example, run the following commands:\n\n```bash\ngit clone https://github.com/oktadev/okta-socket-io-chat-example.git\ncd okta-socket-io-chat-example\n```\n\n### Create an OIDC Application in Okta\n\nCreate a free developer account with the following command using the [Okta CLI](https://github.com/okta/okta-cli):\n\n```shell\nokta register\n```\n\nIf you already have a developer account, use `okta login` to integrate it with the Okta CLI. \n\nProvide the required information. Once you register, create a client application in Okta with the following command:\n\n```shell\nokta apps create\n```\n\nYou will be prompted to select the following options:\n- Type of Application: **2: SPA**\n- Redirect URI: `http://localhost:8080/login/callback`\n- Logout Redirect URI: `http://localhost:8080`\n\nThe application configuration will be printed to your screen:\n\n```shell\nOkta application configuration:\nIssuer:    https://dev-133320.okta.com/oauth2/default\nClient ID: 0oa5qedkihI7QcSoi357\n```\n\nYou will also need to generate a token so that your chat server can communicate with the Okta authentication service. Run `okta login`, open the resulting URL in your browser, sign-in, and navigate to **Security \u003e API**.\n\nSelect the **Tokens** tab. Click on **Create Token** and type in a name for the token. In the following popup, you will be shown the token that has been generated. \n\nReplace the values in `chat-server/chat.js` with these values.\n\n```js\nconst jwtVerifier = new OktaJwtVerifier({\n  clientId: '{yourClientID}',\n  issuer: 'https://{yourOktaDomain}/oauth2/default',\n});\n\nconst oktaClient = new okta.Client({\n  orgUrl: 'https://{yourOktaDomain}',\n  token: '{yourOktaAPIToken}',\n});\n```\n\nUpdate `chat-client/.env` with your Okta settings too.\n\n```dotenv\nPORT=8080\nREACT_APP_OKTA_ORG_URL=https://{yourOktaDomain}\nREACT_APP_OKTA_CLIENT_ID={yourClientID}\n```\n\nIf you haven't done so already, install the dependencies.\n\n```shell\ncd chat-server\nnpm install\n\ncd chat-client\nnpm install\n```\n\nStart the chat server in one terminal window with `npm start`, and the chat client in another window.\n\n```shell\nnpm start\n```\n\nOpen `http://localhost:8080` in your favorite browser and you should be able to log in.\n\n## Links\n\nThis example uses the following open source libraries from Okta:\n\n* [Okta React SDK](https://github.com/okta/okta-react)\n* [Okta JWT Verifier for Node.js](https://github.com/okta/okta-oidc-js/tree/master/packages/jwt-verifier)\n* [Okta CLI](https://github.com/okta/okta-cli)\n\n## Help\n\nPlease post any questions as comments on the [blog post][blog], or visit our [Okta Developer Forums](https://devforum.okta.com/).\n\n## License\n\nApache 2.0, see [LICENSE](LICENSE).\n\n[blog]: https://developer.okta.com/blog/2021/07/14/socket-io-react-tutorial\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-socket-io-chat-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-socket-io-chat-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-socket-io-chat-example/lists"}