Describe the bug
OpenSearch Dashboards encodes useful state in the hash component of the URL, for example:
https://<domain>/app/discover#/?_a=(columns:!(level,loggerCategory,messageText,shardName,tags.subDir,workspaceId))
Currently, the SAML component's nextUrl builder includes url.path but omits url.hash, dropping this state. This creates a problem when sharing links to a particular view without first creating a shortlink, in that the state of that view is lost. For the example above, the redirect would be:
https://<domain>/auth/saml/login?nextUrl=%2Fapp%2Fdiscover
and after authentication, the user would land at:
https://<domain>/app/discover
With no preselected columns.
Expected behavior
I believe the user expect to be redirected back to the exact URL, including hash, as they were at before the authentication redirect. I believe it would be preferable to include url.hash, so the nextUrl would become:
https://<domain>/auth/saml/login?nextUrl=%2Fapp%2Fdiscover%23%2F%3F_a%3D%28columns%3A%21%28level%2CloggerCategory%2CmessageText%2CshardName%2Ctags.subDir%2CworkspaceId%29%29
Additional context
Describe the bug
OpenSearch Dashboards encodes useful state in the
hashcomponent of the URL, for example:Currently, the SAML component's
nextUrlbuilder includesurl.pathbut omitsurl.hash, dropping this state. This creates a problem when sharing links to a particular view without first creating a shortlink, in that the state of that view is lost. For the example above, the redirect would be:and after authentication, the user would land at:
With no preselected columns.
Expected behavior
I believe the user expect to be redirected back to the exact URL, including hash, as they were at before the authentication redirect. I believe it would be preferable to include
url.hash, so thenextUrlwould become:Additional context
security-dashboards-plugin/server/auth/types/saml/saml_auth.ts
Line 57 in afd6497