From bac506e09cd073066dc38602d648eb07857b216b Mon Sep 17 00:00:00 2001 From: Maurizio Vitale Date: Wed, 2 Mar 2022 11:41:37 +0000 Subject: [PATCH] Give the ability to specify a different sso host from the gateway (#7535) --- lib/cli/scripts/init-aae-env.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/cli/scripts/init-aae-env.ts b/lib/cli/scripts/init-aae-env.ts index 8e7026d2fd..3a55e07692 100644 --- a/lib/cli/scripts/init-aae-env.ts +++ b/lib/cli/scripts/init-aae-env.ts @@ -37,6 +37,7 @@ export interface ConfigArgs { devopsPassword: string; clientId: string; host: string; + oauth: string; identityHost: boolean; tag: string; } @@ -267,12 +268,15 @@ function deploy(model: any) { } function getAlfrescoJsApiInstance(configArgs: ConfigArgs) { + let ssoHost = configArgs.oauth; + ssoHost = ssoHost ?? configArgs.host; + const config = { provider: 'BPM', hostBpm: `${configArgs.host}`, authType: 'OAUTH', oauth2: { - host: `${configArgs.host}/auth/realms/alfresco`, + host: `${ssoHost}/auth/realms/alfresco`, clientId: `${configArgs.clientId}`, scope: 'openid', secret: '', @@ -462,6 +466,7 @@ async function main(configArgs: ConfigArgs) { .description('The following command is in charge of Initializing the activiti cloud env with the default apps' + 'adf-cli init-aae-env --host "gateway_env" --modelerUsername "modelerusername" --modelerPassword "modelerpassword" --devopsUsername "devevopsusername" --devopsPassword "devopspassword"') .option('-h, --host [type]', 'Host gateway') + .option('--oauth [type]', 'SSO host') .option('--clientId [type]', 'sso client') .option('--modelerUsername [type]', 'username of a user with role ACTIVIT_MODELER') .option('--modelerPassword [type]', 'modeler password')