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

API/Oauth authentication example #88

Open
atulkakrana opened this issue Jul 8, 2020 · 4 comments
Open

API/Oauth authentication example #88

atulkakrana opened this issue Jul 8, 2020 · 4 comments

Comments

@atulkakrana
Copy link

atulkakrana commented Jul 8, 2020

Hi,
It will help a lot if you can add some examples for FHIR client (client-py) on how we can authenticate sessions/calls from Python? For example - how can we use authenticate to access FHIR API: https://synthea.mitre.org/fhir-api ??

@EricPHassey
Copy link

@atulkakrana have you got any help on authenticate this? Also looking for the same.

@alihbuzaid
Copy link

we need this badly
I was about to write an issue, also against azure services

thanks

@maxschloegel
Copy link

I was also struggling to figure out, how to use user-password authentication with the fhirclient (specifically BasicAuth) until I came across the following stackoverflow answer.
According to this, it is also possible to pass username and password to the url like this:

http://user:passwd@www.server.com/index.html

I then changed my settings-dictionary for the client initialization from:

settings = {
    "app_id": "some_app_id",
    "api_base": "https://my_fhir_server.com"}
smart = fhirclient.client.FHIRClient(settings=settings)

to

user = "username"
pw = "password"
settings = {
    "app_id": "some_app_id",
    "api_base": f"https://{user}:{pw}@my_fhir_server.com"}
smart = fhirclient.client.FHIRClient(settings=settings)

and it works as expected.

While this is a good enough workaround for my case, I only checked this for BasicAuth. And this might not be the most secure solution, but I am no expert on this.

In any case, it would be great to officially address different authentication methods like mentioned in #91 .

@os-netizen
Copy link

@atulkakrana Do you have any update on this? Would love some help as I am facing the same issues

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

No branches or pull requests

6 participants