Repository navigation
12653 check if fine-grained permissions are enabled before retrieving… - #12654
Conversation
|
@hmlnarik I isolated this one out of the other PR.. I will continue with the rest tomorrow... |
There was a problem hiding this comment.
Shouldn't we check org.keycloak.common.Profile.Feature#ADMIN_FINE_GRAINED_AUTHZ instead?
There was a problem hiding this comment.
@pedroigor Could be possible, but I basically just copied how it is done elsewhere like here:
Its basically like that all over the place. ;)
There was a problem hiding this comment.
Sorry. My last comment is because AUTHORIZATION should always be enabled. But not the ADMIN_FINE_GRAINED_AUTHZ feature.
So I'm wondering what difference that condition makes if you remove it or at least change it to ADMIN_FINE_GRAINED_AUTHZ if there is a difference.
There was a problem hiding this comment.
@pedroigor If AUTHORIZATIONis always enabled but the ADMIN_FINE_GRAINED_AUTHZ is the correct one to use, it is probably used wrong all over the place. There is only one place where ADMIN_FINE_GRAINED_AUTHZ is used:
AUTHORIZATION is used much more often and I assume it's used wrong in these places:
I especially find
dangerous, as the decision that fine-grained permissions are not used is essentially taken by searching for a resource server for the realm-management client and not finding it in:
This would mean that if fine-grained permissions were enabled before and a resource server was created for the realm management client, they would still be used even after the profile was changed to not support fine-grained permissions.
WDYT?
|
@pedroigor Any feedback? |
|
@sschu You are right, I think those checks are outdated and referring to the time when authorization services were still tech preview. The reason it works, partially, is that there is a check for resource servers and policies. So if you don't have them created fine-frained admin permissions won't be evaluated. Otherwise, if you enable, set up permissions, and disable, they will be still running. From a security perspective, I think this is not so bad because fine-grained permissions should be more restrictive. But definitely not the behavior we want. So yeah, I think we should update everything to use fine-grained feature instead. |
48ddc5a to
a9ca6b0
Compare
|
@pedroigor I updated this PR to use the correct profile feature name. I will file a bug and send a PR to change all the other places where the feature name was not used correctly. |
|
@pedroigor If you like my updates to the other PR, I would probably change this to not check explicitly for the feature flag but for |
… group memberships of users
a9ca6b0 to
24dd1cd
Compare
|
@pedroigor I changed the implementation to be in line with the changes in #13648. |
… group memberships of users
Fixes #12653