smart-on-fhir / client-py

Python SMART on FHIR client
http://docs.smarthealthit.org
Other
574 stars 209 forks source link

Add ability to use JWT tokens for auth #133

Closed armaghan-behlum closed 1 year ago

armaghan-behlum commented 1 year ago

Used to obtain an access token for a backend service accessing an Epic endpoint: https://fhir.epic.com/Documentation?docId=oauth2&section=BackendOAuth2Guide

Tested locally by authorizing against Epic's Sandbox to fetch data:

settings = {
    'app_id': APP_ID,
    'api_base': 'https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/',
    'scope': 'system/Observation.read system/Patient.read',
    'jwt_token': jwt_token
}

smart = client.FHIRClient(settings=settings)