Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3d Slicer with Keycloak auth not working #1493

Open
demo125 opened this issue Jul 19, 2023 · 3 comments
Open

3d Slicer with Keycloak auth not working #1493

demo125 opened this issue Jul 19, 2023 · 3 comments

Comments

@demo125
Copy link

demo125 commented Jul 19, 2023

I am encountering an issue while configuring Keycloak authentication for the MonaiLabel server/3D Slicer. Although Keycloak is running and I can successfully log in through the login popup in 3D Slicer (verified through Keycloak events), I encounter an error when attempting to load the first image using the "Next Sample" button. The error message states "list index out of range." Upon inspecting the code of the 3D Slicer Monai extension, it appears that there is a problem with downloading an image from the MonaiLabel server.
Here are more details:

What I used:
minailabel server docker image: projectmonai/monailabel:0.7.0
3D Slicer: 5.3.0-2023-06-27
slicer extension installed via developer mode from the up to date master branch

How I run monailabel server
export MONAI_LABEL_AUTH_REALM_URI=http://:8089/realms/monailabel
export MONAI_LABEL_AUTH_ENABLE=True
export MONAI_LABEL_AUTH_CLIENT_ID=monailabel-app
export MONAI_LABEL_AUTH_ROLE_USER=monailabel-user
monailabel start_server --app apps/radiology --studies data/datasets/Task09_Spleen/imagesTr --conf models all

I added "user" to all monailabel groups.
image
I can log in via the popup.
imager

I can see in Keycloak that the login is successful.
image
When I want to load the first image by clicking on "Next Sample"...
image
I get an error:

image
The error line in

self._volumeNode = sampleDataLogic.downloadFromURL(

(my error says that the error is on line 1286, but I added some logs before the line so it is shifted)

image
Here are example values for sampleDataLogic.downloadFromUrl function:
nodeNames="spleen_19.nii.gz"
fileNames="spleen_19.nii.gz"
uris="http://:8025/datastore/image?image=spleen_19"
checksums=None

Console of monailabel server : [2023-07-17 09:42:39,952] [469] [MainThread] [INFO] (monailabel.endpoints.activelearning:60) - Next sample: {'id': 'spleen_52', 'weight': 421328, 'path': '/workspace/data/datasets/Task09_Spleen/imagesTr/spleen_52.nii.gz', 'ts': 1687437902, 'name': 'spleen_52.nii.gz', 'strategy': {'random': {'ts': 1689586959, 'client_id': 'user'}}}

Once I disable the authentication feature and restart the MonaiLabel server, everything functions as expected. I am able to successfully load an image without encountering any issues.

export MONAI_LABEL_AUTH_ENABLE=False
image

Could you please examine the situation to determine if I am making any mistake?
Thanks

@wyli wyli transferred this issue from Project-MONAI/MONAI Jul 19, 2023
@SachidanandAlle
Copy link
Collaborator

I see.. looks like a bug.. because download volume from 3d slicer utils won't pass the required auth header..

It is fixable..

@lassoan
Copy link
Collaborator

lassoan commented Jul 21, 2023

@SachidanandAlle let us know if you want to get an API to pass authentication header.

@SachidanandAlle
Copy link
Collaborator

Yes . That will be the right fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants