MedPlum SMART on FHIR demo
# support
d
Hello, I am currently working on this demo: medplum/medplum-smart-on-fhir-demo And I’m running into the error: “State parameter mismatch - possible security issue” from LaunchPage.tsx when I try to perform an EHR launch. I‘m hosting some sample FHIR data on the MedPlum website, and I would like to perform a EHR launch to view this data in that demo app from MedPlum on localhost. I’ve got my redirect and launch URL set to localhost:8001/launch in the MedPlum ClientApplication settings page, and I’ve set the client ID and auth URL in config.ts as per the README. This error happens because the stored state variable is null, so it doesn’t match the incoming state. I believe this is because the button is sending the wrong request, I think the request should contain a launch and iss parameter that would set the state variable in session storage and then redirect. Has anyone else run this demo? Am I missing something or is there a bug in the demo? Would appreciate any and all help. Regards, Duncan
r
Hi @duncan_55362 , I'm sorry for the poor experience here
Unfortunately the standalone launch flow (from those buttons) isn't yet implemented . We have a small note in the README, but it's easy to miss
You can still use the demo from the "EHR Launch Flow"
d
Hey Rahul, To be clear I am attempting the EHR launch flow using the buttons, which ran into this state mismatch issue. I got the EHR launch working with a hardcoded patient ID, would you accept a PR? https://github.com/medplum/medplum-smart-on-fhir-demo/pull/5 Duncan
f
Hi @duncan_55362 , glad to hear you were able to get it working! Contributions to our example apps are welcomed from members of the community can be made through the [Medplum repo](https://github.com/medplum/medplum) ! You can open a PR there on the [Smart on Fhir Example App](https://github.com/medplum/medplum/tree/main/examples/medplum-smart-on-fhir-demo) in our /examples folder. For more info on contributing, you can see our [contributing docs](https://www.medplum.com/docs/contributing). We generally try to avoid hardcoding patient ids, so I would recommend adding some sort of patient selector for your launch.
d
Filed an issue and a PR with the fix: https://github.com/medplum/medplum/pull/6417 https://github.com/medplum/medplum/issues/6416 Can't add myself as the asignee for the issue, or add tags like
example
and
auth
- think I lack permissions.
r
Thanks so much for the PR @duncan_55362 ! We'll take a look and give you some feedback
Added the tags to the GH Issue - thank you for filing 🙏
284 Views