mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-174] added support for Docker variables to enable OAUTH for DBP (#718)
This commit is contained in:
committed by
Denys Vuika
parent
7532a9a556
commit
791cc861ba
@@ -1,5 +1,53 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
|
||||||
|
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_OAUTH2_HOST}" ];then
|
||||||
|
replace="\/"
|
||||||
|
encoded=${APP_CONFIG_OAUTH2_HOST//\//$replace}
|
||||||
|
sed -e "s/\"host\": \".*\"/\"host\": \"${encoded}\"/g" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
|
||||||
|
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
|
||||||
|
sed "/implicitFlow/s/true/${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ];then
|
||||||
|
sed "/silentLogin/s/true/${APP_CONFIG_OAUTH2_SILENT_LOGIN}/" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}" ];then
|
||||||
|
replace="\/"
|
||||||
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI//\//$replace}
|
||||||
|
sed -e "s/\"redirectSilentIframeUri\": \".*\"/\"redirectSilentIframeUri\": \"${encoded}\"/g" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}" ];then
|
||||||
|
replace="\/"
|
||||||
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGIN//\//$replace}
|
||||||
|
sed -e "s/\"redirectUri\": \".*\"/\"redirectUri\": \"${encoded}\"/g" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then
|
||||||
|
replace="\/"
|
||||||
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT//\//$replace}
|
||||||
|
sed -e "s/\"redirectUriLogout\": \".*\"/\"redirectUriLogout\": \"${encoded}\"/g" \
|
||||||
|
-i ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $ACSURL ]]; then
|
if [[ $ACSURL ]]; then
|
||||||
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /usr/share/nginx/html/app.config.json
|
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /usr/share/nginx/html/app.config.json
|
||||||
fi
|
fi
|
||||||
|
@@ -3,6 +3,17 @@
|
|||||||
"baseShareUrl": null,
|
"baseShareUrl": null,
|
||||||
"providers": "ECM",
|
"providers": "ECM",
|
||||||
"authType": "BASIC",
|
"authType": "BASIC",
|
||||||
|
"oauth2": {
|
||||||
|
"host": "http://localhost:30081/auth/realms/myrealm",
|
||||||
|
"clientId": "alfresco",
|
||||||
|
"scope": "openid",
|
||||||
|
"secret": "",
|
||||||
|
"implicitFlow": true,
|
||||||
|
"silentLogin": true,
|
||||||
|
"redirectSilentIframeUri": "/assets/silent-refresh.html",
|
||||||
|
"redirectUri": "/",
|
||||||
|
"redirectUriLogout": "/logout"
|
||||||
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"name": "Alfresco",
|
"name": "Alfresco",
|
||||||
"logo": "assets/images/alfresco-logo-flower.svg",
|
"logo": "assets/images/alfresco-logo-flower.svg",
|
||||||
|
Reference in New Issue
Block a user