Skip to content

Commit af36cca

Browse files
Update README.md
[#6845] Changed basic:secret to client:secret, added explanation of client:secret concept, merged 2 interrelated setup steps into one
1 parent b8aa03e commit af36cca

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

  • aidbox-forms/aidbox-forms-renderer-offline-mode

aidbox-forms/aidbox-forms-renderer-offline-mode/README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,27 @@ When the interceptor returns `null`, the renderer handles the request itself (us
8080
- An Aidbox instance is running localy (e.g. at `http://localhost:8081`).
8181
- FHIR resources (Patient, Questionnaires, and pre-created QuestionnaireResponses) are added to the Aidbox instance
8282
- A JWT token with access to the FHIR and SDC APIs is created (see [Aidbox Client Credentials documentation](https://www.health-samurai.io/docs/aidbox/tutorials/security-access-control-tutorials/client-credentials-grant):
83-
Go to /ui/console#/iam/sandbox/client.
84-
Check the JWT checkbox.
85-
Specify the Client ID and Client Secret.
86-
In the sandbox console, execute the API requests by clicking Run for each call sequentially.
87-
Copy the JWT from the Access token field.
83+
- Go to /ui/console#/iam/sandbox/client.
84+
- Check the JWT checkbox.
85+
- Specify the client id and client secret. The default credentials are `client_id=basic`, `secret=secret` (you may replace them with any other valid values. Throughout the documentation, this pair is referred to as client:secret. Use the values you provided in the request)
86+
- In the sandbox console, execute the API requests by clicking Run for each call sequentially.
87+
- Copy the JWT from the Access token field.
8888
- QuestionnaireResponses must be created upfront on the server with:
89-
- `status: in-progress`
90-
- `questionnaire` reference pointing to a Questionnaire canonical URL
91-
- `subject` reference pointing to the patient (e.g. `Patient/pt-1`)
89+
- `status: in-progress`
90+
- `questionnaire` reference pointing to a Questionnaire canonical URL
91+
- `subject` reference pointing to the patient (e.g. `Patient/pt-1`)
9292

9393
## Setup
9494

9595
1. Open `index.html` in a text editor
96-
2. Set `AIDBOX_BASE_URL` to your Aidbox instance URL (e.g. `http://localhost:8081`)
96+
2. Set `AIDBOX_BASE_URL` to your Aidbox instance URL (e.g. `http://localhost:8081`) and adjust `renderer-webcomponent.js` link on line 9 (example: `http://localhost:8081/static/aidbox-forms-renderer-webcomponent.js`)
9797
3. Set `AIDBOX_TOKEN` to a valid JWT token
9898
4. Set `PATIENT_ID` to the patient whose assigned forms should be loaded
99-
5. Replace `[AIDBOX_BASE_URL]` with your Aidbox instance URL in link to `renderer-webcomponent.js` (example: `http://localhost:8081/static/aidbox-forms-renderer-webcomponent.js`)
100-
6. Load the fixture data into Aidbox:
99+
5. Load the fixture data into Aidbox:
101100
```bash
102-
./fixtures/load-fixtures.sh http://localhost:8081 basic:secret
101+
./fixtures/load-fixtures.sh http://localhost:8081 client:secret
103102
```
104-
7. Serve `index.html` via any HTTP server (e.g. `npx serve .`) and open generated link in a browser (e.g. `http://localhost:3000`)
103+
6. Serve `index.html` via any HTTP server (e.g. `npx serve .`) and open generated link in a browser (e.g. `http://localhost:3000`)
105104

106105
## Usage
107106

@@ -144,8 +143,8 @@ See the [Aidbox Forms documentation](https://docs.aidbox.app/modules/aidbox-form
144143
- Make sure you opened the page online at least once before going offline.
145144
- Open the browser devtools and check that cached resources exist in localStorage.
146145
- Submission requires connectivity; go back online and click Submit again (or wait for auto-sync).
147-
3. The ./fixtures/load-fixtures.sh http://localhost:8081 basic:secret command stalls
148-
- Verify the client_id and the client secret in basic:secret are correct.
146+
3. The ./fixtures/load-fixtures.sh http://localhost:8081 client:secret command stalls
147+
- Verify the client_id and the client secret in client:secret are correct.
149148
- Verify the Aidbox base URL is correct and reachable (e.g. `http://localhost:8081`).
150149
- Ensure you run the script from the correct working directory — the one that contains `index.html` (so relative paths used by the script resolve correctly).
151150
4. The renderer doesn't load

0 commit comments

Comments
 (0)