Log out
@@ -32,7 +32,7 @@ exports[`Account menu - Log out button renders renders when auth type is not Ope
diff --git a/public/apps/account/test/log-out-button.test.tsx b/public/apps/account/test/log-out-button.test.tsx
index 6021cbad9..e8874c5ba 100644
--- a/public/apps/account/test/log-out-button.test.tsx
+++ b/public/apps/account/test/log-out-button.test.tsx
@@ -68,7 +68,7 @@ describe('Account menu - Log out button', () => {
const component = shallow(
);
- component.find('[data-test-subj="log-out-2"]').simulate('click');
+ component.find('[data-test-subj="log-out-3"]').simulate('click');
expect(logout).toBeCalled();
});
diff --git a/public/apps/account/utils.tsx b/public/apps/account/utils.tsx
index 2a871066c..637f700fa 100644
--- a/public/apps/account/utils.tsx
+++ b/public/apps/account/utils.tsx
@@ -40,6 +40,12 @@ export async function logout(http: HttpStart, logoutUrl?: string): Promise
logoutUrl || `${http.basePath.serverBasePath}/app/login?nextUrl=${nextUrl}`;
}
+export async function samlLogout(http: HttpStart): Promise {
+ // This will ensure tenancy is picked up from local storage in the next login.
+ setShouldShowTenantPopup(null);
+ window.location.href = `${http.basePath.serverBasePath}${API_AUTH_LOGOUT}`;
+}
+
export async function updateNewPassword(
http: HttpStart,
newPassword: string,
diff --git a/server/auth/types/saml/saml_auth.ts b/server/auth/types/saml/saml_auth.ts
index 6b4ec03e5..ee8762406 100644
--- a/server/auth/types/saml/saml_auth.ts
+++ b/server/auth/types/saml/saml_auth.ts
@@ -58,6 +58,7 @@ export class SamlAuthentication extends AuthenticationType {
return escape(path);
}
+ // Check if we can get the previous tenant information from the expired cookie.
private redirectSAMlCapture = (request: OpenSearchDashboardsRequest, toolkit: AuthToolkit) => {
const nextUrl = this.generateNextUrl(request);
const clearOldVersionCookie = clearOldVersionCookieValue(this.config);
diff --git a/test/jest_integration/saml_auth.test.ts b/test/jest_integration/saml_auth.test.ts
index 827e961b7..53d2a951e 100644
--- a/test/jest_integration/saml_auth.test.ts
+++ b/test/jest_integration/saml_auth.test.ts
@@ -329,8 +329,7 @@ describe('start OpenSearch Dashboards server', () => {
await driver.manage().deleteAllCookies();
await driver.quit();
- // TODO Intentionally commented to make the CI pass, will be enabled after rebase in https://github.com/opensearch-project/security-dashboards-plugin/pull/1058
- // expect(tenantName).toEqual('Global');
+ expect(tenantName).toEqual('Global');
});
});