{"id":23421103,"url":"https://github.com/nhsdigital/nhs-notify-iam-webauth","last_synced_at":"2025-04-12T14:04:18.415Z","repository":{"id":247562074,"uuid":"801577466","full_name":"NHSDigital/nhs-notify-iam-webauth","owner":"NHSDigital","description":"NHS Notify Identity and Access Management (IAM) for Web and API Authorisation ","archived":false,"fork":false,"pushed_at":"2025-04-09T08:17:59.000Z","size":3457,"stargazers_count":3,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T08:33:56.443Z","etag":null,"topics":["nhs-notify"],"latest_commit_sha":null,"homepage":"https://nhsdigital.github.io/nhs-notify-iam-webauth/","language":"HCL","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/NHSDigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-16T13:56:24.000Z","updated_at":"2025-04-09T08:18:02.000Z","dependencies_parsed_at":"2024-07-22T16:48:52.145Z","dependency_job_id":"904350b8-8b44-47b4-9133-7dba04daedef","html_url":"https://github.com/NHSDigital/nhs-notify-iam-webauth","commit_stats":null,"previous_names":["nhsdigital/nhs-notify-iam","nhsdigital/nhs-notify-web-auth"],"tags_count":8,"template":false,"template_full_name":"NHSDigital/nhs-notify-repository-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fnhs-notify-iam-webauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fnhs-notify-iam-webauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fnhs-notify-iam-webauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fnhs-notify-iam-webauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NHSDigital","download_url":"https://codeload.github.com/NHSDigital/nhs-notify-iam-webauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578861,"owners_count":21127713,"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":["nhs-notify"],"created_at":"2024-12-23T02:14:02.119Z","updated_at":"2025-04-12T14:04:18.410Z","avatar_url":"https://github.com/NHSDigital.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NHS Notify IAM Web Auth repository\n\nNextJS application deployed via AWS Amplify to act as a login portal for NHS users.\n\nRead more about the technical design at [REFCOM-2024-007: WebUI User Auth](https://nhsd-confluence.digital.nhs.uk/display/RIS/REFCOM-2024-007%3A+WebUI+User+Auth).\n\n## Setting up locally\n\n### Git\n\n- Make sure you have GitHub access with the right permissions\n- Setup git locally on your machine\n- Set your local git email as you `*@nhs.net` email `e.g. git config --global user.email \"firstname.lastname1@nhs.net\"`\n- Setup commit signing (this is required before you can commit any code to the repository). This is a very good resource to help Mac users `https://gist.github.com/troyfontaine/18c9146295168ee9ca2b30c00bd1b41e`\n- Pull the repository here `git@github.com:NHSDigital/nhs-notify-web-template-management.git`\n\n### Development and Tools\n\n- Install `asdf` [HERE](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf). We use this tool to manage the required version for packages (this can be found in the `.tool-versions` file at the root of the project) on the project. You can use other tools usch as `brew`, `apt`, etc, but you will be risking having different package versions to other developers.\n- Then you need to install the following plugins:\n\n  ```shell\n    asdf plugin-add nodejs\n    asdf plugin-add direnv\n    asdf plugin-add terraform\n    asdf plugin-add gitleaks\n    asdf plugin-add pre-commit\n  ```\n\n- Now you can install the tools, and they will be runnable from within the `nhs-notify-web-template-management` directory:\n\n  ```shell\n    asdf install\n  ```\n\n- Now you can run the command below to install the packages in the project:\n\n  ```shell\n    npm install\n  ```\n\n### Creating a backend sandbox\n\nTo create a backend sandbox intended for use with local development, run the command\n\n```shell\n  npm run create-backend-sandbox environment-name\n```\n\nsubstituting your environment name in as appropriate.\n\nThis command will also generate an amplify_outputs file in the root of the repository that will be used when running the app locally.\n\nTo destroy the sandbox when it is no longer needed, run the command\n\n```shell\n  npm run destroy-backend-sandbox environment-name\n```\n\n### Connecting to an existing Cognito instance\n\nYou can point the app at any existing Cognito instance, not necessarily one you have created, by updating the user_pool_id and user_pool_client_id values in the amplify_outputs file.\n\n### Setup a user in Cognito\n\nIn order to use a new Cognito user pool, you can run the sandbox auth script with your chosen email and password:\n\n```bash\n./scripts/sandbox_auth.sh email password\n```\n\nYou can also manually create a user in that user pool:\n\n1. Log into the `nhs-notify-iam-dev` AWS account\n2. Load AWS Cognito\n3. Open the relevant Cognito user pool\n4. Select `Create user`\n5. Enter details\n   1. Use your .nhs email address\n   2. Select randomly generated password\n   3. Select Send an email invitation\n6. Wait for email to arrive in your .nhs inbox\n7. Load web application and sign in\n\n## Running project locally\n\nHaving created your backend sandbox or otherwise set up your amplify_outputs file, you can start the app locally by running\n\n```bash\nnpm run dev\n```\n\n### Running WebAuth and Templates projects locally\n\n[Read more](https://github.com/NHSDigital/nhs-notify-web-template-management/blob/main/README.md#running-templates-and-webauth-projects-locally)\n\n## Testing\n\n### Unit tests\n\n```**bash**\nnpm run test:unit\n```\n\n### Playwright automated tests\n\nYou'll need to ensure you have an authenticated terminal to `nhs-notify-iam-dev` AWS account. Then run:\n\n```bash\ncd tests/test-team\nnpm run test:local-ui\n```\n\n## Environment variables\n\n### NEXT_PUBLIC_USER_POOL_ID\n\nValue from your Cognito instance\n\n### NEXT_PUBLIC_USER_POOL_CLIENT_ID\n\nValue from your Cognito instance\n\n### NEXT_PUBLIC_COGNITO_DOMAIN\n\nValue from your Cognito instance\n\n### NEXT_PUBLIC_REDIRECT_DOMAIN\n\nValue from your Cognito instance\n\n### NEXT_PUBLIC_CIS2_PROVIDER_NAME\n\nValue from your Cognito instance\n\n### NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS\n\nThe inactive page displays configurable content that informs users of the duration of inactivity before logout. This duration is determined by the `NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS` variable, which should be synchronized with the corresponding value in the `nhs-notify-web-template-management` repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhsdigital%2Fnhs-notify-iam-webauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhsdigital%2Fnhs-notify-iam-webauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhsdigital%2Fnhs-notify-iam-webauth/lists"}