client-js
client-js copied to clipboard
How to use in mobile app
How can the fhir client be used in a mobile app, when using a framework like apache cordova??
When using the fhir client and have a patient/clinician login, there needs to be a redirect URL. But if it is running in a mobile app, what can the redirect URL be, or is there another way to log a user in using username+password with the FHIR client?
I have never done it myself but I know that people are successfully using app-claimed URLs - https://www.oauth.com/oauth2-servers/redirect-uris/redirect-uris-native-apps/
Yes, I've seen that page too. Since that is oauth2's page, one would think it would have links or more information on the subject. Who else would have information on oauth2, besides oauth2 themselves?
For posterity, this is the documentation I know of: Platform-specific link association: Android, iOS, Windows, and other platforms have introduced a method by which a native app can claim an HTTPS redirect URL, demonstrate ownership of that URL, and instruct the OS to invoke the app when that specific HTTPS URL is navigated to. Apple's iOS calls this feature "Universal Links"; Android, "App Links"; Windows, "App URI Handlers". This association of an HTTPS URL to native app is platform-specific and only available on some platforms.
Oh, and the AppAuth SDK for electron apps functions more like the server-side implementation of this library:
- Construct the authorize request URL, cache the state
- Open a localhost http server to listen for the redirect
- Open the authorize request in the system default browser
- Receive the auth code and state on the localhost redirect