You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The FhirServer is configured to work with client credentials, but seems to never request a token.
FhirServer._get_oidc_token() is the code where a token would be requested but seems to be never called anywhere.
The examples and documentation suggest that fhir_server = FhirServer("https://fhir.server/fhir", client_id="client_id", client_secret="secret", oidc_provider_url="url")
should be enough to get the authorization working.
How is this supposed to work?
To Reproduce
fhir_server = "https://localhost:443/fhir"
oidc_provider_url = "https://localhost:443/iam/oauth2/token"
client_id = None
client_secret = None
with open("appsettings.json") as sfp:
settings = json.load(sfp)
client_id = settings["ClientID"]
client_secret = settings["ClientSecret"]
# Connect using oauth2/oidc
oidc_server = FhirServer(fhir_server, client_id=client_id, client_secret=client_secret,
oidc_provider_url=oidc_provider_url)
# Query resources based on name of resource
query = oidc_server.query("Patient", output_format="json").all()
Expected behavior
Tokens are requested using client id and client secret.
Additional context
fhir-kindling 1.0.2 with Python 3.11.5
The text was updated successfully, but these errors were encountered:
You are right.. Oauth2 auth flow seems to just not be used 😅. It was there some time ago but must have fallen out during some merge very early. I'll look into it. A fix shouldn't take too long.
I've just published version 1.0.3. which has basic OIDC support. Let me know if this works for you. I hope I can add more sophisticated OIDC support soon.
Describe the bug
The FhirServer is configured to work with client credentials, but seems to never request a token.
FhirServer._get_oidc_token() is the code where a token would be requested but seems to be never called anywhere.
The examples and documentation suggest that
fhir_server = FhirServer("https://fhir.server/fhir", client_id="client_id", client_secret="secret", oidc_provider_url="url")
should be enough to get the authorization working.
How is this supposed to work?
To Reproduce
Expected behavior
Tokens are requested using client id and client secret.
Additional context
fhir-kindling 1.0.2 with Python 3.11.5
The text was updated successfully, but these errors were encountered: