GithubHelp home page GithubHelp logo

Comments (4)

TheTallMan67 avatar TheTallMan67 commented on August 19, 2024

I get the same error from Cerner. Even waiting 1 second is a long time. Is no FHIR service is implementing this should the call even be made in the first place?

from client-js.

nschwertner avatar nschwertner commented on August 19, 2024

Since the .well-known/smart-configuration endpoint is part of the spec, it would be expected that the client would query it by default. It would be reasonable though to add some sort of configuration options for adapting better to quirky legacy implementations.

from client-js.

vlad-ignatov avatar vlad-ignatov commented on August 19, 2024

.well-known/smart-configuration is expected to become the default way of detecting the auth endpoints and that is why it is tried first. One of the reasons is simply that the CapabilityStatement is too big to download and too slow to parse, just to extract a few strings. I guess nobody would have expected to have to wait so much for 404 response.

I will include some kind of patch for this in the next release soon. So far I think that the best solution might be based on Promise.any, so that both are tried in parallel, no time is wasted and the faster method wins...

If you consider making a PR, please don't. I'm at the end of difficult transition to TypeScript and any PR would be very difficult to merge.

from client-js.

vlad-ignatov avatar vlad-ignatov commented on August 19, 2024

This should be fixed in the latest version 2.2.0. Both /metadata and /.well-known/smart-configuration are requested at the same time (in parallel). Whoever arrives first is used, and the other one is canceled. This means that you should experience no slowdowns, and once your Epic instance hosts a .well-known/smart-configuration file, you can expect your app to boot much faster.

BTW, this also lead to adding some new functionality in 2.2.0 - Aborting Requests

I should mention that there is one issue that I stumbled upon:

  1. The authorization is optional for a FHIR server. It is valid to have an open server that does not specify an authorize endpoint in it's CapabilityStatement.
  2. However, according to the documentation at http://www.hl7.org/fhir/smart-app-launch/conformance/index.html#using-well-known, the authorization_endpoint is required in the well-known json. This means one cannot have an open server with well-known json, does it?

Right now I am following the spec. If the library fetches a well-known json but it does not have authorization_endpoint or token_endpoint, it will be discarded as invalid and the CapabilityStatement will be used.

I hope @jmandel can share his opinion on why authorization_endpoint and token_endpoint are documented as required.

from client-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.