API Rest not working with keycloak docker-compose

Hello everyone,

I have used the following Docker Compose file:

I added HTTPS, used the domain “orthanc.local”, and correctly generated the certificates. So far, no issues—I can navigate, create a token from UI2, and successfully open it in OHIF.

Now, I need to upload studies and query a specific study via the API to generate a token for creating the access URL. I enabled port 8042, which is not exposed by default in the compose file. However, when I try to send a POST request to /tools/find, I get a Bad Request error, indicating that I am not authenticated.

I have followed the instructions in the README exactly as described but still cannot get it to work.

Does anyone have an idea of how to better understand this process? If I repeat these steps without Keycloak (using basic auth), I have no issues using the API.

There was a problem with de api key. If anyone needs help tell me.

Solved!

Hello,

If you have found other errors in the sample above, it would be really great if you could perhaps create a PR or explain here what the required changes are.

Thanks in advance!

–Benjamin