Give the ability to specify a different sso host from the gateway (#7535)

This commit is contained in:
Maurizio Vitale
2022-03-02 11:41:37 +00:00
committed by GitHub
parent f995284bb8
commit bac506e09c

View File

@@ -37,6 +37,7 @@ export interface ConfigArgs {
devopsPassword: string; devopsPassword: string;
clientId: string; clientId: string;
host: string; host: string;
oauth: string;
identityHost: boolean; identityHost: boolean;
tag: string; tag: string;
} }
@@ -267,12 +268,15 @@ function deploy(model: any) {
} }
function getAlfrescoJsApiInstance(configArgs: ConfigArgs) { function getAlfrescoJsApiInstance(configArgs: ConfigArgs) {
let ssoHost = configArgs.oauth;
ssoHost = ssoHost ?? configArgs.host;
const config = { const config = {
provider: 'BPM', provider: 'BPM',
hostBpm: `${configArgs.host}`, hostBpm: `${configArgs.host}`,
authType: 'OAUTH', authType: 'OAUTH',
oauth2: { oauth2: {
host: `${configArgs.host}/auth/realms/alfresco`, host: `${ssoHost}/auth/realms/alfresco`,
clientId: `${configArgs.clientId}`, clientId: `${configArgs.clientId}`,
scope: 'openid', scope: 'openid',
secret: '', 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' + .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"') 'adf-cli init-aae-env --host "gateway_env" --modelerUsername "modelerusername" --modelerPassword "modelerpassword" --devopsUsername "devevopsusername" --devopsPassword "devopspassword"')
.option('-h, --host [type]', 'Host gateway') .option('-h, --host [type]', 'Host gateway')
.option('--oauth [type]', 'SSO host')
.option('--clientId [type]', 'sso client') .option('--clientId [type]', 'sso client')
.option('--modelerUsername [type]', 'username of a user with role ACTIVIT_MODELER') .option('--modelerUsername [type]', 'username of a user with role ACTIVIT_MODELER')
.option('--modelerPassword [type]', 'modeler password') .option('--modelerPassword [type]', 'modeler password')