fhir_client
fhir_client copied to clipboard
Unable to obtain Access Token from Authorization Code
First off I'd like to say that i'm pretty new to FHIR and OAuth2 in general. I could very well just be missing something here.
I'm attempting to perform a SMART on FHIR launch utilizing this gem and the stated Oauth 2.0 workflow in the readme, but the readme doesn't seem like it would ever work? The launches i'm going through recommend redirecting to the authorization url provided in the initial launch, and then you will receive a request to your agreed upon redirect_uri. This redirect_uri then exchanges the code in the parameters for an access token.
This entire flow doesn't seem to be supported by the gem and i'm not sure how i'm supposed to utilize the gem to perform this. To make this work we've had to complete the auth outside of the gem, but I would still like to use the gem for ease of accessing APIs. I kind of have two questions.
- Am i correct in that the gem does not support a flow that involves a redirect_uri?
- Is there a way to initialize a client with an existing Access Token?
You might find this conversation useful: https://groups.google.com/forum/#!topic/cerner-fhir-developers/rOJZodIJFGc
@Mysrt We use both access token and OAuth flow here, maybe I can help ;) Can you share with use your implementation of this gem ?
It looks from the linked conversation that the redirect_uri flow is doable with this gem using set_bearer_token
but the documentation in the README seems incomplete in terms of explaining how this flow would work. Our business will likely be using this in coming months and will post a PR with more complete documentation if so.