From 2c4b0006ccd1a702a933bfb634e2f0afd91c9809 Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 21 Sep 2023 21:33:11 +0200 Subject: [PATCH] bugfix oidc client not working the file gets created, but you need to wait some time to get data into it --- docker/devicehub.entrypoint.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/devicehub.entrypoint.sh b/docker/devicehub.entrypoint.sh index 800d04c7..220cdef6 100755 --- a/docker/devicehub.entrypoint.sh +++ b/docker/devicehub.entrypoint.sh @@ -119,18 +119,21 @@ config_oidc() { # in DEVICEHUB_HOST we remove anything before :// client_id_config="/shared/client_id_${DEVICEHUB_HOST#*://}" + client_id= + client_secret= # wait that the file generated by the server_id is readable while true; do if [ -f "${client_id_config}" ]; then - break + client_id="$(cat "${client_id_config}" | jq -r '.client_id')" + client_secret="$(cat "${client_id_config}" | jq -r '.client_secret')" + if [ "${client_id}" ] && [ "${client_secret}" ]; then + break + fi fi sleep 1 done - client_id="$(cat "${client_id_config}" | jq -r '.client_id')" - client_secret="$(cat "${client_id_config}" | jq -r '.client_secret')" - flask add_client_oidc \ "${SERVER_ID_HOST}" \ "${client_id}" \