diff --git a/x-pack/platform/plugins/shared/cloud/server/plugin.ts b/x-pack/platform/plugins/shared/cloud/server/plugin.ts index 3ed81a866ae4e..a7a2b761f22a3 100644 --- a/x-pack/platform/plugins/shared/cloud/server/plugin.ts +++ b/x-pack/platform/plugins/shared/cloud/server/plugin.ts @@ -249,7 +249,7 @@ export class CloudPlugin implements Plugin { }, async (context, request, response) => { const { uiSettings, savedObjects } = await context.core; - const defaultRoute = await uiSettings.client.get('defaultRoute'); + const defaultRoute = await uiSettings.client.get('defaultRoute', { request }); const nextCandidateRoute = parseNextURL(request.url.href); const route = nextCandidateRoute === '/' ? defaultRoute : nextCandidateRoute; diff --git a/x-pack/test/functional_cloud/saml.config.ts b/x-pack/test/functional_cloud/saml.config.ts index be752fa553bce..67fe34a5b818a 100644 --- a/x-pack/test/functional_cloud/saml.config.ts +++ b/x-pack/test/functional_cloud/saml.config.ts @@ -69,6 +69,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '--xpack.security.authc.providers.saml.saml1.realm=saml1', '--xpack.security.authc.providers.basic.basic1.order=1', '--server.restrictInternalApis=false', + '--uiSettings.overrides.defaultRoute=/app/observability/landing', ], }, uiSettings: { diff --git a/x-pack/test/functional_cloud/tests/onboarding.ts b/x-pack/test/functional_cloud/tests/onboarding.ts index c02cf2002d8d6..5f15f5a7f1e33 100644 --- a/x-pack/test/functional_cloud/tests/onboarding.ts +++ b/x-pack/test/functional_cloud/tests/onboarding.ts @@ -55,6 +55,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await deleteSavedObject(); }); + it('Only redirect', async () => { + await browser.get(deployment.getHostPort() + `/app/cloud/onboarding`); + await find.byCssSelector('[data-test-subj="userMenuButton"]', 20000); + + // We need to make sure that both path and hash are respected. + const currentURL = parse(await browser.getCurrentUrl()); + expect(currentURL.pathname).to.eql('/app/observability/landing'); + }); + it('Redirect and save token', async () => { await browser.get( deployment.getHostPort() +