Skip to content

Commit

Permalink
[ADF-4259] ClientId shouldn't be in the config file (Alfresco#4930)
Browse files Browse the repository at this point in the history
* add delete users missing in ps cloud e2e

* clientId use config param

* Update test.config.js
  • Loading branch information
eromano authored Jul 13, 2019
1 parent 098577f commit 5703c45
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
authType: 'OAUTH',
oauth2: {
host: browser.params.testConfig.adf.hostSso,
clientId: 'alfresco',
clientId: browser.params.config.oauth2.clientId,
scope: 'openid',
secret: '',
implicitFlow: false,
Expand All @@ -74,7 +74,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
describe('SSO in ADF using ACS and AIS, implicit flow set', () => {

beforeAll(async (done) => {
const apiService = new ApiService('alfresco', browser.params.testConfig.adf.url, browser.params.testConfig.adf.hostSso, 'ECM');
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.testConfig.adf.url, browser.params.testConfig.adf.hostSso, 'ECM');
await apiService.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

identityService = new IdentityService(apiService);
Expand All @@ -93,7 +93,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity,
silentLogin, implicitFlow, 'alfresco');
silentLogin, implicitFlow, browser.params.config.oauth2.clientId);

loginSsoPage.clickOnSSOButton();
loginSsoPage.loginSSOIdentityService(acsUser.id, acsUser.password);
Expand Down
2 changes: 1 addition & 1 deletion e2e/core/auth-guard/auth-guard-sso.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Auth Guard SSO', () => {
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity,
false, true, 'alfresco');
false, true, browser.params.config.oauth2.clientId);

loginSSOPage.clickOnSSOButton();
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
Expand Down
12 changes: 6 additions & 6 deletions e2e/core/login/login-sso/login-sso.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ describe('Login component - SSO', () => {
it('[C261050] Should be possible login with SSO', () => {
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, false, true, 'alfresco');
browser.params.testConfig.adf.hostIdentity, false, true, browser.params.config.oauth2.clientId);
loginSSOPage.clickOnSSOButton();
loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
});

it('[C280667] Should be redirect directly to keycloak without show the login page with silent login', () => {
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, true, true, 'alfresco');
browser.params.testConfig.adf.hostIdentity, true, true, browser.params.config.oauth2.clientId);
loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
});
});
Expand All @@ -63,7 +63,7 @@ describe('Login component - SSO', () => {
it('[C299205] Should display the login error message when the SSO identity service is wrongly configured', () => {
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
'http://aps22/auth/realms/alfresco',
browser.params.testConfig.adf.hostIdentity, false, true, 'alfresco');
browser.params.testConfig.adf.hostIdentity, false, true, browser.params.config.oauth2.clientId);
loginSSOPage.clickOnSSOButton();
loginSSOPage.checkLoginErrorIsDisplayed();
expect(loginSSOPage.getLoginErrorMessage()).toContain('SSO Authentication server unreachable');
Expand All @@ -76,13 +76,13 @@ describe('Login component - SSO', () => {
implicitFlow = false;
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, silentLogin, implicitFlow, 'alfresco');
browser.params.testConfig.adf.hostIdentity, silentLogin, implicitFlow, browser.params.config.oauth2.clientId);

loginPage.waitForElements();

settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, silentLogin, implicitFlow, 'alfresco');
browser.params.testConfig.adf.hostIdentity, silentLogin, implicitFlow, browser.params.config.oauth2.clientId);
browser.ignoreSynchronization = true;

loginPage.enterUsername(browser.params.testConfig.adf.adminEmail);
Expand All @@ -108,7 +108,7 @@ describe('Login component - SSO', () => {
it('[C280665] Should be possible change the logout redirect URL', () => {
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, false, true, 'alfresco', '/login');
browser.params.testConfig.adf.hostIdentity, false, true, browser.params.config.oauth2.clientId, '/login');
loginSSOPage.clickOnSSOButton();
loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
navigationBarPage.clickLogoutButton();
Expand Down
4 changes: 2 additions & 2 deletions e2e/core/user-info-component-cloud.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('User Info - SSO', () => {
let identityService: IdentityService;

beforeAll(async (done) => {
const apiService = new ApiService('alfresco', browser.params.testConfig.adf.url, browser.params.testConfig.adf.hostSso, 'ECM');
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.testConfig.adf.url, browser.params.testConfig.adf.hostSso, 'ECM');
await apiService.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

identityService = new IdentityService(apiService);
Expand All @@ -38,7 +38,7 @@ describe('User Info - SSO', () => {
silentLogin = false;
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, silentLogin, true, 'alfresco');
browser.params.testConfig.adf.hostIdentity, silentLogin, true, browser.params.config.oauth2.clientId);

loginSSOPage.clickOnSSOButton();

Expand Down
2 changes: 1 addition & 1 deletion e2e/process-services-cloud/start-task-form-cloud.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe('Start Task Form', () => {
browser.params.config.bpmHost,
browser.params.config.oauth2.host,
browser.params.config.identityHost,
'alfresco');
browser.params.config.oauth2.clientId);
loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
await LocalStorageUtil.setConfigField('adf-cloud-start-process', JSON.stringify(startProcessCloudConfig));
done();
Expand Down
4 changes: 2 additions & 2 deletions e2e/test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const PROXY = process.env.PROXY_HOST_ADF;
const LOG = process.env.LOG;
const BPM_HOST = process.env.URL_HOST_BPM_ADF || "bpm";
const OAUTH_HOST = process.env.URL_HOST_SSO_ADF || "keycloak";
const OAUTH_CLIENDID = process.env.OAUTH_CLIENDID || "activiti";
const OAUTH_CLIENT_ID = process.env.OAUTH_CLIENDID || "alfresco";

const IDENTITY_HOST = process.env.URL_HOST_IDENTITY || "identity";
const IDENTITY_ADMIN_EMAIL = process.env.IDENTITY_ADMIN_EMAIL || "defaultadmin";
Expand All @@ -39,7 +39,7 @@ const appConfig = {
"authType": "OAUTH",
"oauth2": {
"host": OAUTH_HOST,
"clientId": OAUTH_CLIENDID,
"clientId": OAUTH_CLIENT_ID,
"scope": "openid",
"secret": "",
"implicitFlow": true,
Expand Down

0 comments on commit 5703c45

Please sign in to comment.