### Start the App Source: https://github.com/govuk-one-login/simulator/blob/main/CONTRIBUTING.md Build the application and then start it. Ensure dependencies are up-to-date before starting. ```shell npm run build && npm run start ``` -------------------------------- ### Build the App Source: https://github.com/govuk-one-login/simulator/blob/main/CONTRIBUTING.md Use this command to install dependencies and build the application. ```shell npm ci && npm run build ``` -------------------------------- ### Setup Pre-commit Hook Source: https://github.com/govuk-one-login/simulator/blob/main/CONTRIBUTING.md Run this command to set up the pre-commit hook for the project. ```shell npm run prepare ``` -------------------------------- ### Example Invalid Request Response Source: https://github.com/govuk-one-login/simulator/blob/main/docs/interactive-mode.md This JSON shows an example error response when an invalid field is submitted in the interactive mode form. ```json { "error": "invalid_request", "invalid_fields": [ { "field": "a field name", "msg": "an error message" } ] } ``` -------------------------------- ### Run Acceptance Tests Source: https://github.com/govuk-one-login/simulator/blob/main/CONTRIBUTING.md Follow the steps to set up a local .env file with credentials from the dev account, then run the acceptance tests. ```shell ./run-acceptance-tests.sh ``` -------------------------------- ### Run Unit and Integration Tests Source: https://github.com/govuk-one-login/simulator/blob/main/CONTRIBUTING.md Execute this command to run all unit and integration tests for the project. ```shell npm run test ``` -------------------------------- ### Check Formatting and Linting Source: https://github.com/govuk-one-login/simulator/blob/main/CONTRIBUTING.md Run these commands to check for formatting and linting issues. Use specific commands to check only prettier or linting. ```shell npm run check; # Check all ``` ```shell npm run check:pretty; # Check prettier ``` ```shell npm run check:lint; # Check linting ``` -------------------------------- ### Sequence Diagram for Simulator Interaction Source: https://github.com/govuk-one-login/simulator/blob/main/README.md Illustrates the flow of requests and responses between a Relying Party (RP) and the GOV.UK One Login Simulator during an authorization process. ```mermaid sequenceDiagram RP->>Simulator:/authorize Simulator-)RP: Redirect URL + Auth code RP->>Simulator:/token Simulator-)RP: access_token and id_token RP->>Simulator:/userinfo ``` -------------------------------- ### Configure Simulator URL via API Source: https://github.com/govuk-one-login/simulator/blob/main/docs/configuration.md Set the simulator's hosting URL using the /config endpoint. This affects other endpoints and validation. ```json { "simulatorUrl": "https://example.com/deployed-simulator" } ``` -------------------------------- ### Default Configuration Table Source: https://github.com/govuk-one-login/simulator/blob/main/docs/default-config-values.md This table outlines the default configuration values for the GOV.UK One Login simulator. It specifies values for return codes, simulator URL, post-logout redirect URLs, and token authentication method. ```markdown | returnCodes | `null` | | simulatorUrl | `http://localhost:3000` | | postLogoutRedirectUrls | `["http://localhost:8080/signed-out]` | | tokenAuthMethod | `private_key_jwt` | ``` -------------------------------- ### Default Private Key for Public Key Source: https://github.com/govuk-one-login/simulator/blob/main/docs/default-config-values.md This is the default private key used for the public key in the GOV.UK One Login simulator. It is essential for secure authentication processes. ```text -----BEGIN PRIVATE KEY----- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCZddHcSxG9QxWE Qky1DXB7EmN9DTRDQxDsBF9KE3ncGc5AQ8WdL8jye0F12Qp0Ter68xMjvbDoW/dK wwz5yJHYsgd0RB8qCwu3o8Y1xXWQboYb/edJbemxbzDrlDd+bLzU/Xvjyp7MOtV9 oasXg8NcAvNfWmH6fPyakqZyTppjosRQngH5Mh9jOUqabAV7euLSylJb4nnAT2aZ PdWRHbJK4dFgdCXGUX119fuW05OxuAkXM3pM7TVlAOFjSIvDN0bCFLE7pHo39kg1 gcIoU9pAP610qyvDtAMhifHQiJcWeQaeLOXdS2pKZcBpx5O88zY/PzjHYmLAeunZ KaXpFgsJAgMBAAECggEAGtEkgb8ak/zPm0OsvOzizZb6jMVMbz6ei+f9sOezYVuf F8rgEyZhEsKoP0xUz9s352+n1hSVgB1mGwn30ASVPA1sUQyAd6vjec1kW0wszbcK t4SIsOPEtU2NenV1tyGQZBYB2t4zHtRfL2ubhunvLzqSxgR437mMuQRMkugagbOQ CRPhwslZECcZvmOh5HURkbE0L5F1uXckc+tf0hktgiI4LB+Eej9e4TkhHnv6B9pe ye jfk/O+48O3sZ2emYgY6TSqcgwutj6UipROknyAorWUQ8vTaSewm6HO++cRH5a/ D0JPoLX7uM8JcosIIiLE1p6qihjhPRe65Rvb7tSMOwKBgQDQBMHkETsQlb26vGhm 9Fc29GQJFe0yTZVD/94U98hpfbOu22E3TslXzpsNoCR61zgZdM7dWQINi3AvonFS QJlDEYGNX0zYOqT1goI+3tBMpptnNzfgRN72bp748JiUyWLnjcWUNc2gwIEc2yET wR4Zxz6A7h1iA9+fM/rEE1ULHwKBgQC823VoUO7p13WvdrYrmM93Xc6Cv5nZFLZn bFjt4xwi096yJ2BTxARFhCBYaDD9vi4yzKjHih/1G53T6aaRbuLaNOSO58jHY1eh par1Xw+JjKwK7bnFGOY+mGAT9kz/agDQv+ELu6PpgiRW/Awiz9UW5OV0cquQIhRj 60yn25PM1wKBgQCI2YhhLUDJUWnHbunUSY0S90bUf1tTy5yWZr9I1hY/6FWMhID5 bNii7qYtGZzGP86FWMY68rKaDJDalaitrxfk+qBbTEX2vuYFKj3bdKReuQDlr3sQ DN8OCoqFRWtr/u0VXryMG7VSuzJ1tGeXYmYWGXEySvSDpf648u5XjkxViwKBgQCO +9COJAhePuQ47jXKGC2q//ikARAnzIi1ENDbeoEI1UPbufgyM0vQndInXOsKkXxE tbJrMGY1mq0JjfKwVTWnYzhQAah/XPUxy0396/TFfR2cQJPPZ6Saa58CPg3ZqpXn df6adXwKBKAiwz0k9hks9ivK2C6QN10csT8eLx5djQKBgQCiVnIJ3JcjNXHlygCW eZG4zLcylZXusOv3VYBJKypBLVI74buoFfrvMcV/lQrI3Yo+6V95rNYGm+2MVxIc iZSejbyqjUjJBAH9GH9PsiA+w1vutdd2PuPKOV05TLmV5ZM06bmLHQjMCGMiWK0G 8qVxFvr2NWRDB3otAjxVHR/ZQA== -----END PRIVATE KEY----- ``` -------------------------------- ### Fix Formatting and Linting Source: https://github.com/govuk-one-login/simulator/blob/main/CONTRIBUTING.md Execute these commands to automatically fix formatting and linting issues. Specific commands are available for prettier and linting. ```shell npm run fix; # Fix all ``` ```shell npm run fix:pretty; # Fix prettier ``` ```shell npm run fix:lint; # Fix linting ``` -------------------------------- ### Client Configuration JSON Structure Source: https://github.com/govuk-one-login/simulator/blob/main/docs/configuration.md This JSON structure is required in the request body when updating the client configuration using the /config endpoint. It includes the client ID, scopes, and other potential fields. ```json { "clientConfiguration": { "clientId": "aClientId", "scopes": ["openid", "phone", "email"], ...other fields }, } ``` -------------------------------- ### Simulator Response Configuration JSON Source: https://github.com/govuk-one-login/simulator/blob/main/docs/configuration.md This JSON structure is required in the request body when updating the response configuration using the /config endpoint. It allows setting various user attributes for simulated responses. ```json { "responseConfiguration": { "sub": "someSubjectIdentifier", "email": "anExampleEmail@example.com" , ...other fields }, } ``` -------------------------------- ### Configure Errors via JSON Payload Source: https://github.com/govuk-one-login/simulator/blob/main/docs/configured-errors.md Use this JSON structure to configure specific error scenarios for Core Identity, ID Token, and Authorize endpoints via the /config endpoint. ```json { "errorConfiguration": { "coreIdentityErrors": ["INVALID_ALG_HEADER"], "idTokenErrors": ["INVALID_ISS"], "authoriseErrors": ["ACCESS_DENIED"] } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.