Skip to content

[BUG] SAML login nextUrl drops URL hash #831

@markj-db

Description

@markj-db

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions