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

When hitting the account client with the referrer parameter ,the AccountConsole doesn't support the relative Client URLs #16484

Closed
2 tasks done
iingawal opened this issue Jan 16, 2023 · 4 comments · Fixed by #17338
Assignees
Labels
area/account/api kind/bug Categorizes a PR related to a bug team/rh-iam
Milestone

Comments

@iingawal
Copy link
Contributor

Before reporting an issue

  • I have searched existing issues
  • I have reproduced the issue with the latest release

Area

account/api

Describe the bug

When referrer parameter is used on the Account client (e.g. http:///auth/realms//account/?referrer=), the generated 'Back to XXX' link does not contain actual relative url which is used in base url of client.

e.g- hit below url , the "Back to Admin Console" does not show the actual redirect url of Test client ,if we added the relative url in "Base URL " of Test client .

http://localhost:8080/auth/realms/testrealm/account/?referrer=Test#/

Version

18

Expected behavior

Actual behavior

How to Reproduce?

Anything else?

No response

@iingawal iingawal added kind/bug Categorizes a PR related to a bug status/triage labels Jan 16, 2023
@ghost ghost added the area/account/api label Jan 16, 2023
@iingawal
Copy link
Contributor Author

Any update on this ?

@mposolda
Copy link
Contributor

When looking at this, I've ended up sending PR with fixing this :-) Hopefully we can include this in Keycloak 22.

@Lunkwill-Fook
Copy link

I suppose the problem is in line 226 of AccountConsole.java
https://github.com/keycloak/keycloak/blob/main/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java

ClientModel referrerClient = realm.getClientByClientId(referrer); if (referrerClient != null) { if (referrerUri != null) { referrerUri = RedirectUtils.verifyRedirectUri(session, referrerUri, referrerClient); } else { referrerUri = ResolveRelative.resolveRelativeUri(session, client.getRootUrl(), referrerClient.getBaseUrl()); }

@mposolda
Copy link
Contributor

@Lunkwill-Fook yes, see the linked PR for the details #17338

@stianst stianst modified the milestones: 22.0.0, 21.1.0 Apr 14, 2023
jonkoops pushed a commit to jonkoops/keycloak that referenced this issue Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/account/api kind/bug Categorizes a PR related to a bug team/rh-iam
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants