{"id":20307311,"url":"https://github.com/oktadev/okta-react-hooks-example","last_synced_at":"2025-10-16T14:36:18.800Z","repository":{"id":40417680,"uuid":"261864242","full_name":"oktadev/okta-react-hooks-example","owner":"oktadev","description":"React Hooks Example","archived":false,"fork":false,"pushed_at":"2022-05-10T00:03:44.000Z","size":394,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T11:21:22.838Z","etag":null,"topics":["authentication","javascript","oidc","react-hooks","reactjs"],"latest_commit_sha":null,"homepage":"https://developer.okta.com/blog/2020/05/01/move-from-higher-order-components-to-react-hooks","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-06T19:52:42.000Z","updated_at":"2022-05-10T00:03:48.000Z","dependencies_parsed_at":"2022-08-09T19:50:38.570Z","dependency_job_id":null,"html_url":"https://github.com/oktadev/okta-react-hooks-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-hooks-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-hooks-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-hooks-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-hooks-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-react-hooks-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429112,"owners_count":21101783,"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","javascript","oidc","react-hooks","reactjs"],"created_at":"2024-11-14T17:17:10.853Z","updated_at":"2025-10-16T14:36:13.778Z","avatar_url":"https://github.com/oktadev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Hooks Example\n \nThis example app shows how to create a React app and use React Hooks for authentication.\n\nPlease read [How to Move from Consuming Higher-Order Components to React Hooks](https://developer.okta.com/blog/2020/05/01/move-from-higher-order-components-to-react-hooks) to see how this app was created.\n\n**Prerequisites:** \n\n* [Node 12+](https://nodejs.org/en/) installed\n* An [Okta Developer Account](https://developer.okta.com/signup)\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 install this example application, run the following commands:\n\n```bash\ngit clone https://github.com/oktadeveloper/okta-react-hooks-example.git\ncd okta-react-hooks-example\nnpm install\n```\n\n### Create an OIDC App on Okta\n\nRegister a new application by going to **Applications** \u003e **Add Application**. On the next screen, choose **Single Page App** and click **Next**.\n\nOn the following screen, you can edit the application's settings. Make sure that the port number is 3000 and the base URI is `http://localhost:3000/`. Change the Login Redirect URI to `http://localhost:3000/callback`. Once you are done, you will see a **Client ID**.\n\n### Configure your Okta Settings\n\nCopy your Okta domain and client ID into `src/config.js`:\n\n```js\nexport default {\n  oidc: {\n    clientId: '{yourClientID}',\n    issuer: 'https://{yourOktaDomain}/oauth2/default',\n    redirectUri: 'http://localhost:3000/callback',\n    scopes: ['openid', 'profile', 'email'],\n    pkce: true\n  }\n}\n```\n\nStart everything with `npm start`, click the **Profile** link, and you'll be prompted to login with React and Okta.\n\n## Links\n\nThis example uses the following open source libraries:\n\n* [React](https://reactjs.org/)\n* [Okta React SDK](https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react)\n\n## Help\n\nPlease post any questions as issues in this repository, 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-react-hooks-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-react-hooks-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-react-hooks-example/lists"}