Repository navigation
KEYCLOAK-16832: using realm name instead of id - #7724
Conversation
in order to get localization texts
pedroigor
left a comment
There was a problem hiding this comment.
@stummb This is a valid fix.
I'm also dealing with it on #7712. There, I'm basically returning both name and id when using a non-master admin user.
However, your steps in KEYCLOAK-16832 to reproduce the issue may be missing assgining the view-realm role. Otherwise, you should get a 403 when reaching that endpoint.
Could you check if this is true?
| currentRealm = Current.realm.id; | ||
| translateProvider.translations(locale, resourceBundle); | ||
| RealmSpecificLocalizationTexts.get({id: currentRealm, locale: locale}, function (localizationTexts) { | ||
| RealmSpecificLocalizationTexts.get({id: Current.realm.realm, locale: locale}, function (localizationTexts) { |
There was a problem hiding this comment.
This is confusing. Either the API is using realm id - then the original code is correct, or the API is using unique realm name (realm) - then this fix should be accompanied with the change in RealmSpecificLocalizationTexts that renames id to realm for the sake of consistency.
There was a problem hiding this comment.
I don't think there is anything to change. Otherwise, we would be asking for refactoring (IMO, not really the scope here) other parts of the admin console too.
API-wise, there is a weird behavior where the id might not be returned but the name. Something I also catched in #7712.
From my side, looks good.
There was a problem hiding this comment.
Yup, this should have been caught earlier, when introducing the first inconsistency. I don't see this as a blocinkg issue, rather a reminder that we should be more careful when doing PR reviews.
There was a problem hiding this comment.
@hmlnarik True, thanks Hynek. Hope we improve test coverage of the admin console. Something I think is being considered from day one on the new account console. Mainly specific use cases like this one (admin permissioning).
I did that with the master admin user, who has the view-realm role. Note that KEYCLOAK-16832 was not opened by me, I just felt that it was the same bug. In our setup we have several realms where id = realm name, and one where both values differ from eachother. When switching to this realm, we get the error in the ticket. Also when reloading the page. However, clicking browser back button gives uns the overview page of the realm. When I go to the Localization tab then, I see the /realms/localization/en url being called with realm name instead of id. |
|
So what is preventing this from being merged now? I'm facing the same issue. |
|
@hmlnarik Are you ok with merging this? |
Yes. https://issues.redhat.com/browse/KEYCLOAK-17003 was introduced as a follow-up task. |
|
@hmlnarik Would it be possible to have a backmerge for 12.x ? This issue is not huge but my team is considering to skip Keycloak 12 until the next major which is likely to come end of february/march. |
in order to get localization texts