Hi, we are trying to create a backend service app so we can integrate
with Epic’s FHIR API, and we have been following the backend service
documentation from the epic docs ( Documentation - Epic on FHIR ), and haven’t been able to make it
work.
The response we get is
{
“error”: “invalid_client”,
“error_description”: null
}
The request we are making is a POST to /interconnect-fhir-oauth/oauth2/token, with:
{
“grant_type”: “client_credentials”,
“client_assertion_type”: “urn:ietf:params:oauth:client-assertion-type:jwt-bearer”,
“client_assertion”: <>
}
And the JWT has the following data:
{
“typ”: “JWT”,
“alg”: “HS256”
}
{
“iss”: <>,
“sub”: <>,
“aud”: “https://fhir.epic.com/interconnect-fhir-oauth/oauth2/token”,
“exp”: <<now + 5 minutes (in seconds) >>, // example: 1678818868
“iat”: <<now (in seconds) >>, // example: 1678818508
“jti”: <>, // example: “6ddyAYN5bHwpDlO3LPW9h4BJLpppJYSB”
“alg”: “HS256”
}
And we are encrypting it with our private and public key.
Is there something we are missing/doing wrong? In the App window in Epic’s Developer App manager, we have setted up localhost as the non production JWK set url.