Skip to content

Commit

Permalink
Merge pull request #3128 from gbarbon/fix-openIdEntrypointRedundantVar
Browse files Browse the repository at this point in the history
Removed redundant OpenID variables to trigger the generic OpenID provider
  • Loading branch information
Coduz authored Nov 2, 2020
2 parents eeadccb + 8a5795e commit 95cc7d3
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions assembly/console/entrypoint/run-console
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,21 @@ if [ -n "$KEYCLOAK_URL" ] && [ -n "$KAPUA_CONSOLE_URL" ]; then
fi

# Check for generic OpenID Connect provider integration
if [ -n "$KAPUA_CONSOLE_URL" ] && [ -n "$OPENID_JWT_ISSUER" ] && [ -n "$OPENID_AUTH_ENDPOINT" ] && [ -n "$OPENID_LOGOUT_ENDPOINT" ] && [ -n "$OPENID_TOKEN_ENDPOINT" ]; then
if [ -n "${KAPUA_CONSOLE_URL}" ] && [ -n "${OPENID_JWT_ISSUER}" ]; then
echo "Activating OpenID Connect Generic integration..."
echo " Kapua: $KAPUA_CONSOLE_URL"
echo " OpenID Issuer: $OPENID_JWT_ISSUER"
echo " Auth Endpoint: $OPENID_AUTH_ENDPOINT"
echo " Logout Endpoint: $OPENID_LOGOUT_ENDPOINT"
echo " Token Endpoint: $OPENID_TOKEN_ENDPOINT"

: OPENID_CLIENT_ID=${OPENID_CLIENT_ID:=console}
: JWT_AUDIENCE=${JWT_AUDIENCE:=console}
echo " OpenID Issuer: ${OPENID_JWT_ISSUER}"
echo " Console: ${KAPUA_CONSOLE_URL}"

JAVA_OPTS="$JAVA_OPTS -Dsso.provider=generic"
JAVA_OPTS="$JAVA_OPTS -Dsso.openid.client.id=${OPENID_CLIENT_ID}"
test -n "$CLIENT_SECRET" && JAVA_OPTS="$JAVA_OPTS -Dsso.openid.client.secret=${CLIENT_SECRET}"
JAVA_OPTS="$JAVA_OPTS -Dconsole.sso.home.uri=${KAPUA_CONSOLE_URL}"
JAVA_OPTS="${JAVA_OPTS} -Dsso.provider=generic"
JAVA_OPTS="${JAVA_OPTS} -Dsso.openid.client.id=${OPENID_CLIENT_ID:-console}"
test -n "${CLIENT_SECRET}" && JAVA_OPTS="${JAVA_OPTS} -Dsso.openid.client.secret=${CLIENT_SECRET}"
JAVA_OPTS="${JAVA_OPTS} -Dconsole.sso.home.uri=${KAPUA_CONSOLE_URL}"

JAVA_OPTS="$JAVA_OPTS -Dsso.generic.openid.jwt.audience.allowed=${JWT_AUDIENCE}"
JAVA_OPTS="$JAVA_OPTS -Dsso.generic.openid.jwt.issuer.allowed=${OPENID_JWT_ISSUER}"
JAVA_OPTS="$JAVA_OPTS -Dsso.generic.openid.server.endpoint.auth=${OPENID_AUTH_ENDPOINT}"
JAVA_OPTS="$JAVA_OPTS -Dsso.generic.openid.server.endpoint.logout=${OPENID_LOGOUT_ENDPOINT}"
JAVA_OPTS="$JAVA_OPTS -Dsso.generic.openid.server.endpoint.token=${OPENID_TOKEN_ENDPOINT}"
JAVA_OPTS="${JAVA_OPTS} -Dsso.generic.openid.jwt.audience.allowed=${JWT_AUDIENCE:-console}"
JAVA_OPTS="${JAVA_OPTS} -Dsso.generic.openid.jwt.issuer.allowed=${OPENID_JWT_ISSUER}"
test -n "${OPENID_AUTH_ENDPOINT}" && JAVA_OPTS="${JAVA_OPTS} -Dsso.generic.openid.server.endpoint.auth=${OPENID_AUTH_ENDPOINT}"
test -n "${OPENID_LOGOUT_ENDPOINT}" && JAVA_OPTS="${JAVA_OPTS} -Dsso.generic.openid.server.endpoint.logout=${OPENID_LOGOUT_ENDPOINT}"
test -n "${OPENID_TOKEN_ENDPOINT}" && JAVA_OPTS="${JAVA_OPTS} -Dsso.generic.openid.server.endpoint.token=${OPENID_TOKEN_ENDPOINT}"
fi

# Multi Factor Authentication configurations
Expand Down

0 comments on commit 95cc7d3

Please sign in to comment.