Prompted for Login twice on SMART-on-FHIR launch
# support
t
Hello Medplum, I am currently developing and testing SMART integration while self-hosting. I am referring to this documentation. First question: When I remove the launchUri from ClientApplication, the page at http://localhost:3000/Patient/4d266f81-8915-4936-bd12-da6e8f450d1c/apps displays "No apps found. Contact your administrator." However, when I add the launchUri, the list appears. Is this the expected behavior? Second question: I want to allow a Practitioner to use SMART, but even when launchUri is present, the page at http://localhost:3000/Practitioner/4525f45a-598a-489b-b9cd-855dbda7af2d/apps does not display the list. and.. "No apps found. Contact your administrator." How can I resolve this issue? Looking forward to your guidance. Thanks!
cc @minha_1268
And... Is it possible to create a SMART client app with Medplum and register it in the Medplum app at https://app.medplum.com/admin/clients? I am currently developing a SMART app by referring to https://docs.smarthealthit.org/tutorials/javascript/.
t
The action I wanted to perform was as follows: 1. Log in to Medplum client app A. 2. Click a button inside app A. 3. Redirect to Medplum client apps B or C. 4. Run Medplum client apps B or C without requiring an additional login. I spent time customizing based on this example ( https://github.com/medplum/medplum/tree/rahul-smart-on-fhir-example ), but after launching the SMART app, it didn't automatically maintain the login state, and I had to log in to Medplum again. Could it be that I don't fully understand SMART on FHIR? Would SSO be necessary for this kind of functionality?
Is there any other easier way?
Is it possible to do this using token-exchange? 1. Log in to A. 2. Set A's ACCESS_TOKEN as a parameter and redirect to B. 3. Use medplum.exchangeExternalAccessToken() with params.access_token. https://www.medplum.com/docs/auth/methods/token-exchange
r
Hi @two4zero_63114 , I'll try my best to answer these in sequence 🙂 > When I remove the launchUri from ClientApplication, the page at http://localhost:3000/Patient/4d266f81-8915-4936-bd12-da6e8f450d1c/apps displays "No apps found. Contact your administrator." > However, when I add the launchUri, the list appears. Is this the expected behavior? Yes that's the expected behavior. In truth, the Medplum App is meant to be a console for developers, rather than an EMR. However, it can be used to simulate the EHR launch flow. Our lightweight simulation logic is to list all
ClientApplications
that have a
launchUri
as a way of determining all the SMART-on-FHIR apps
> I want to allow a Practitioner to use SMART, but even when launchUri is present, the page at http://localhost:3000/Practitioner/4525f45a-598a-489b-b9cd-855dbda7af2d/apps does not display the list. and.. "No apps found. Contact your administrator." > How can I resolve this issue? As part of our "simulated EHR" experience, right now we only support launching from the Encounter and Patient contextsx
> I spent time customizing based on this example ( https://github.com/medplum/medplum/tree/rahul-smart-on-fhir-example ), but after launching the SMART app, it didn't automatically maintain the login state, and I had to log in to Medplum again. Ahh yes, I recently made an update to this example: https://github.com/medplum/medplum/pull/5872/commits/1469aaaeea87e32d3a2135fb53b115660b7cd854
This should prevent the additional login
the key was using the
prompt=none
query param
t
@rahul1 Thank you for your response. Also, thanks to rahul-smart-on-fhir-example. I performed the test using commit 84acce. with
prompt=none
And... I think my question was a bit unclear. I wanted the B app, running from A while logged in, to be in a logged-in state without requiring any login at all. Additionally, I am now trying to test token-exchange in the B app using A's Medplum access token. Is this the correct approach?
https://github.com/medplum/medplum/pull/5872#discussion_r1944215699 In the README.md, shouldn't "5. Click the 'Launch Sample App' button" be corrected to "5. Click the 'Launch' button" instead?
183 Views