Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: isCallbackFromSts fails to handle hash location correctly #2075

Open
zach-singleops opened this issue Feb 16, 2025 · 0 comments
Open

Comments

@zach-singleops
Copy link

zach-singleops commented Feb 16, 2025

Version

19.0.0.0

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

There are no errors but the isCallbackFromSts check inside the UrlService returns false when using hash routing

Inside the getUrlWithoutQueryParameters function it fails to correctly remove the query parameters since the query parameters are inside the window.location.hash property

Below searchParams is empty since it's all in the hash property

getUrlWithoutQueryParameters(url) {
        const u = new URL(url.toString());
        const keys = [];
        for (const key of u.searchParams.keys()) {
            keys.push(key);
        }
        keys.forEach((key) => {
            u.searchParams.delete(key);
        });
        return u;
    }

Steps to reproduce the behavior

Set up an angular app and configure the router to use hash location, provideRouter(routes, withHashLocation())

Then configure OAuth and make sure the redirectUri also includes /#/

Once the identity server redirects to the redirect uri, you can observe that checkAuth fails to handle the redirect since it doesn't recognize that it's a callback

A clear and concise description of what you expected to happen.

I expect that after authenticating on the identity server, it will redirect and then correctly recognize it's a callback url and finish up with the OAuth process

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant