Xelem
07/28/2026, 10:38 PMPOST /admin/projects/{projectId}/client
6. Requested a token via:
POST /oauth2/token
grant_type=client_credentials
7. Received a valid JWT.
The decoded JWT contains client_id, profile, login_id, correct `iss`/`aud`, etc.
However, every request returns 401, including:
* GET /auth/me
* GET /fhir/R4/Patient
* POST /fhir/R4/Organization
The response is always:
json
{
"resourceType": "OperationOutcome",
"issue": [
{
"code": "login",
"details": {
"text": "Unauthorized"
}
}
]
}
Things I've verified:
* Official Docker Compose deployment (medplum/medplum-server:5.1.21)
* Authorization header is Bearer <token>
* Token is issued successfully by the same server (http://localhost:8103)
* Same behavior whether using the bootstrap project or a newly created project
* Super admin JWT works for FHIR requests
Is a ClientApplication obtained via the client_credentials flow supposed to authenticate directly against the FHIR API? Is there an additional bootstrap/configuration step I'm missing, or could this be a known issue in 5.1.21? Any guidance would be appreciated.reshma
07/29/2026, 7:27 PM