Authenticating into Medplum when consuming webhook...
# support
y
Hi all, I set up the endpoint url for the third party (Twilio) correctly with all of the IDs necessary (client id, secret, and bot id), but I still get an unauthorized error when cURLing the endpoint as well as it not accessing my bot. I've tried adding access policies to make it work but still get unauthorized:
Copy code
{
  "resourceType": "OperationOutcome",
  "id": "unauthorized",
  "issue": [
    {
      "severity": "error",
      "code": "login",
      "details": {
        "text": "Unauthorized"
      }
    }
  ],
  "extension": [
    {
      "url": "https://medplum.com/fhir/StructureDefinition/tracing",
      "extension": [
        {
          "url": "requestId",
          "valueId": "4dd888d2-0291-4dff-b84e-d9923d44973b"
        },
        {
          "url": "traceId",
          "valueId": "7d7c6093-3e3f-4638-b652-151913831b30"
        }
      ]
    }
  ]
}
For some added context, I am able to get auth credentials when I curl the oauth2 token url. So the client id and secret do work to auth into my medplum app
Copy code
curl -X POST https://api.kips.health/oauth2/token \
r
cc: @Deleted User
Thanks for the question @yurtric . The twilio Webhooks API doesn't perform preemptive Basic Auth, as described here: https://www.twilio.com/docs/usage/security#http-authentication Instead, it expects a response of 401 Unauthorized with a WWW-Authenticate header, before sending credentials.
A change is required to the Medplum bot execute endpoints to make this work, and we are tracking this issue here: https://github.com/medplum/medplum/issues/4140
d
thanks for the info @rahul1! Any idea why that fix was reverted? was there an issue with it?
r
That's right, we were seeing some intended behavior in Medplum App, so we're going to have to take another pass
182 Views