Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App launch Failed to discover authorization URL given #4

Open
usmanbahadur opened this issue Sep 25, 2019 · 13 comments
Open

App launch Failed to discover authorization URL given #4

usmanbahadur opened this issue Sep 25, 2019 · 13 comments

Comments

@usmanbahadur
Copy link

@vlad-ignatov i am trying to launch this app against smart health open fhir server but the app fails with the error " Failed to discover authorization URL given"
Untitledq
Untitledqq

@usmanbahadur
Copy link
Author

@nschwertner @jmandel hi guys do you know what the issue is here why the launch is failing?

@vlad-ignatov
Copy link
Contributor

It seems that your launchURI is not getting any of the necessary URL parameters. Can you describe how you "launch" it?

@usmanbahadur
Copy link
Author

@vlad-ignatov i git cloned the app into visual studio code and then did npm install and npm run serve as suggested in docs then i opened the launch page where i see this error.

@vlad-ignatov
Copy link
Contributor

OK, that makes sense. To launch a SMART app you cannot just open the launch page in browser. Instead you need to know the URL of that page (say http://localhost/launch.html). That is your launch URI that you should use to launch the app from external system (like an EHR). The simplest way to try that is to go to http://launch.smarthealthit.org, paste that URL in the "App Launch URL" field at the bottom and click "Launch App". You can also pre-select a Patient and Practitioner, or you can skip that and let the app ask you for whatever it needs.

@usmanbahadur
Copy link
Author

@vlad-ignatov sorry i should have been more specific when i said i open the launch page i meant when i did npm run serve i got the following localhost and i did the launch http://127.0.0.1:8000/launch
i tried ehr http://launch.smarthealthit.org as well and selected a patient but the error is 127.0.0.1 sent an invalid response.
image

@vlad-ignatov
Copy link
Contributor

It is a static HTML app so I believe your launch url might be http://127.0.0.1:8000/launch.html instead of http://127.0.0.1:8000/launch. Does that work?

@usmanbahadur
Copy link
Author

usmanbahadur commented Oct 9, 2019

with remobing .html extension and only using http://127.0.0.1:8000/launch error becomes refuse to connect.
image

@vlad-ignatov

@vlad-ignatov
Copy link
Contributor

OK, here are couple of things I'd like to ask you to do. These can help us understand what is happening:

  1. In http://launch.smarthealthit.org, make your usual settings (put the launch url, select a patient etc.) All the changes you make there are reflected in the URL of that page, so once you are ready to click "Launch App", instead of clicking it send me that URL.
  2. Same as above, but then right click on the "Launch App" and copy and send me the link address (that green button is actually a link).
  3. Uncheck the "Simulate launch within the EHR user interface" checkbox. That puts your app within an iframe which makes it harder to debug.
  4. Open your app (http://127.0.0.1:8000/index.html) in new tab. Disregard the fact that it is not working and just open the JS console and execute localStorage.setItem("debug", "FHIR.*");. Also make sure your logs are preserved: Screen Shot 2019-10-09 at 10 09 13 AM
    Then you can close that tab and try to re-launch. Next time you launch, keep an eye on the console - it might output something useful.
  5. What version of client-js are you using and on what Browser and OS?

@vlad-ignatov
Copy link
Contributor

OK, so I can't be sure what your issue is, but I installed the app to try it and I found some problems. Apparently, it has not been updated for a while and I will have to do that now...

Meanwhile, I think should still be launch-able against DSTU-2. In your case, you should be able to open this link and click "Launch App".

I will let you know when the update is complete.

@vlad-ignatov
Copy link
Contributor

The update should be complete now. The app is now using the latest fhirclient library and should load faster. To update, cd into the project folder and run git pull && npm i && npm serve (or better yet, delete it and clone ind install again). Then launch it from the link I sent above.

Note that this app is designed for DSTU-2 only. For newer FHIR versions there is http://apps.smarthealthit.org/app/bp-centiles-v2

@usmanbahadur
Copy link
Author

@vlad-ignatov Thanks for fixing this i can confirm that this works against DSTU2 smart health api, there is no source code available for R3 version of the app, where can i get the code? http://apps.smarthealthit.org/app/bp-centiles-v2

@vlad-ignatov
Copy link
Contributor

I think v2 is not an open source but I'm not 100% sure. @nschwertner is the best person to answer that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants