docker behind nginx. doubt with redirect

52 views
Skip to first unread message

Pela Silveira

unread,
May 16, 2023, 2:55:52 PM5/16/23
to dcm4che
Hi dear DCM4CHE community,

I am playing around with a docker compose deployment. I configure an nginx runing in front of the archive and keycloak.

I have this problem, 

The only way I make it work is with this 2 env vars:
ARCHIVE_HOST=my-domain.ar
ARCHIVE_HTTPS_PORT=443
this generate this conf in keycloak for redirect url, as this is replaced during the importation of the dcm4che realm:
https://my-domain.ar:443/dcm4chee-arc/ui2

the problem is that when i try to reach de UI I get : 
We are sorry...

Invalid parameter: redirect_uri


I can fix it editing this parameters in Realm Management through  Keycloak UI


Do you know if it is possible to configure it in some way that this manual step is avoided??


than you in advance!!!


Cheers 


PS

Pela Silveira

unread,
May 17, 2023, 1:45:08 PM5/17/23
to dcm4che
I make this, if it is of interest to anyone:
Makefile for running inside of docker-host, 

include docker-compose.env
fix_redirect:
docker exec -it dcm4chee-keycloak-1 kcadm.sh config credentials --server http://dcm4chee-keycloak-1:8880 --realm master --user  admin --password changeit
docker exec -it dcm4chee-keycloak-1 kcadm.sh get clients -r dcm4che  --fields 'id,clientId' > tmp
jq -c ".[] | select(.clientId == \"dcm4chee-arc-ui\")" tmp | jq -r .id > tmp2
clientUuid=$(cat tmp2)
docker exec -it dcm4chee-keycloak-1 kcadm.sh update clients/${clientUuid} -r dcm4che -s 'rootUrl=https://${ARCHIVE_HOST}/dcm4chee-arc/ui2'
docker exec -it dcm4chee-keycloak-1 kcadm.sh update clients/${clientUuid} -r dcm4che -s 'redirectUris=["https://${ARCHIVE_HOST}/dcm4chee-arc/ui2/*","http://${ARCHIVE_HOST}/dcm4chee-arc/ui2/*"]'
docker exec -it dcm4chee-keycloak-1 kcadm.sh update clients/${clientUuid} -r dcm4che -s 'webOrigins=["https://${ARCHIVE_HOST}","http://${ARCHIVE_HOST}"]'
docker exec -it dcm4chee-keycloak-1 kcadm.sh update clients/${clientUuid} -r dcm4che -s 'adminUrl=https://${ARCHIVE_HOST}/dcm4chee-arc/ui2'
jq -c ".[] | select(.clientId == \"dcm4chee-arc-rs\")" tmp | jq -r .id > tmp2
clientUuid=$(cat tmp2)
docker exec -it dcm4chee-keycloak-1 kcadm.sh update clients/${clientUuid} -r dcm4che -s 'rootUrl=https://${ARCHIVE_HOST}/dcm4chee-arc'
docker exec -it dcm4chee-keycloak-1 kcadm.sh update clients/${clientUuid} -r dcm4che -s 'webOrigins=["https://${ARCHIVE_HOST}","http://${ARCHIVE_HOST}"]'
docker exec -it dcm4chee-keycloak-1 kcadm.sh update clients/${clientUuid} -r dcm4che -s 'adminUrl=https://${ARCHIVE_HOST}/dcm4chee-arc'

cheers!
Reply all
Reply to author
Forward
0 new messages