{"id":22268094,"url":"https://github.com/curityio/react-haapi-demo","last_synced_at":"2025-07-28T12:30:53.556Z","repository":{"id":59394671,"uuid":"518866886","full_name":"curityio/react-haapi-demo","owner":"curityio","description":"A demo HAAPI OpenID Connect implementation in a React app","archived":false,"fork":false,"pushed_at":"2024-11-05T14:01:23.000Z","size":3456,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-05T15:18:20.165Z","etag":null,"topics":["code-example","haapi","oauth2","openid-connect","react","spa"],"latest_commit_sha":null,"homepage":"https://curity.io/resources/learn/react-haapi-demo/","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curityio.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":"2022-07-28T13:54:40.000Z","updated_at":"2024-11-05T14:01:25.000Z","dependencies_parsed_at":"2024-06-13T13:18:45.009Z","dependency_job_id":null,"html_url":"https://github.com/curityio/react-haapi-demo","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/curityio%2Freact-haapi-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Freact-haapi-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Freact-haapi-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Freact-haapi-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curityio","download_url":"https://codeload.github.com/curityio/react-haapi-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227905532,"owners_count":17837906,"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":["code-example","haapi","oauth2","openid-connect","react","spa"],"created_at":"2024-12-03T11:11:05.707Z","updated_at":"2025-07-28T12:30:53.547Z","avatar_url":"https://github.com/curityio.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HAAPI demo application with React\n\nThis is a demo application that implements the Hypermedia Authentication API to log users in. The application is written\nusing the React framework.\n\n## Running the demo\n\nTo run the demo app:\n\n1. Install dependencies by running `npm i`\n2. Set configuration settings in `src/config.js`, e.g. endpoints of the Curity Identity Server, client ID, etc.\n3. Run the app with `npm start`. A browser will be opened navigating to `http://localhost:3000`.\n\n## Running with the provided instance of the Curity Identity Server\n\nThe `/idsvr` folder contains scripts that let you start an instance of the Curity Identity Server preconfigured to work with this app.\nYou need Docker Desktop installed on your machine to run the scripts. To run the instance:\n\n1. Copy a `license.json` file to the `/idsvr` folder that contains a valid license for the Curity Identity Server. You can obtain\n   the license through Curity's [dev portal](https://developer.curity.io).\n2. Copy `/idsvr/idsvr.env-template` to `/idsvr/idsvr.env`. You need to fill the proper configuration options only if you\n   want to use the Google authenticator. See [the section below](#configuring-the-google-authenticator) for details.\n3. Start the server with `./idsvr/deploy.sh`\n4. Start the demo app as described above.\n\n### Configuring the Google Authenticator\n\nThe provided instance of the Curity Identity Server has a Google authenticator configured. This is to show how the Hypermedia\nAuthentication API deals with authenticators that have to redirect the user to an external page. In order for the authenticator\nto work properly, you need to configure it with the client ID and client secret that will be used to perform the OIDC flow\nat Google. Have a look at [this documentation](https://cloud.google.com/docs/authentication/end-user) to learn how to\nregister an OAuth client in the Google console. Once you've obtained an ID and secret, paste them in the `/idsvr/idsvr.env` file.\n\nHave a look at the [authenticator's documentation](https://curity.io/docs/idsvr/latest/authentication-service-admin-guide/authenticators/google.html)\nto learn what other options can be configured for this method.\n\n### Accept the Self-Signed Certificate\n\nThe instance of the Curity Identity Server uses self-signed SSL certificates. Before testing with the SPA, navigate to\n[https://localhost:8443](https://localhost:8443) and let your browser trust the certificate. This can be done in a few ways\nand depends on your Operating System and browser:\n- Download the certificate and add it to your system keychain.\n- Choose to trust the certificate by selecting an appropriate option from the toolbar.\n- Accept the security exception when visiting the website.\n\n### Testing the App\n\nNavigate to `https://localhost:3000` and log in using either of the options:\n\n- With the username authenticator, enter any username. It will be used as the subject in the resulting tokens.\n- With the Username-password authenticator using the credentials `demouser / Password1`.\n\n### Teardown\n\nUse the `./idsvr/teardown.sh` script to clear any containers created.\n\n## Further Resources\n\nHave a look at these resources to learn more about Curity and HAAPI:\n\n- [The Curity Identity Server's documentation](https://curity.io/docs)\n- [HAAPI documentation](https://curity.io/docs/haapi-web-sdk/latest/)\n- [HAAPI overview](https://curity.io/resources/learn/api-driven-demo-client/)\n- [Curity's resources](https://curity.io/resources/)\n\nDon't hesitate to [contact us](https://curity.io/contact/) should you need any assistance with this demo. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Freact-haapi-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurityio%2Freact-haapi-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Freact-haapi-demo/lists"}