Repository navigation
Conversation
There was a problem hiding this comment.
Firstly, I'm sorry for the long time to respond to this PR.
There's a few issues I see with the approach taken in this PR:
- T&C are periodically invalidated, which means a user could have to approve terms and conditions again a few minutes after they've already done so.
- Background/timer task to periodically expire T&C is fairly expensive and not needed really. It would be better to simple check during authentication time if a given users acceptance has expired or not.
- The approach to providing configuration for the T&C is not ideal, and should rather be configuration on the required action itself, instead at the realm level. This makes it quite a bit more tricky to implement this change as a first step would be to support configuration options for required actions themselves.
Rather than having a time that invalidates terms and conditions periodically for all users I'd rather like to see an max-age on terms and conditions approval, and then check that when users authenticate.
First of all, thanks @stianst for evaluating this PR. Let me answer on your points, one by one (i am struggling a bit to remember what i have done many months before :P ) Regarding the first one, the T&C are not just periodically invalidated. What really happens is that they are periodically checked and if an expiry has occured, then they get invalidated :)
@stianst Please, check also the PR #7841 which is simpler - whenever an admin changes the T&C, he/she might wish to require all users to reaccept the new one!!! |
|
With regard to performance this is going to be pretty horrible. Let's say you have 1000+ realms you're fetching and looping over all those realms every 15 minutes. Now let's say you have 100+ million users in one realm, you're again fetching and looping over all those users every 15 minutes. |
|
With regard to how it is configured it really isn't suitable to hard-code the config for a specific action like you're doing in the admin console. Nor is it really ideal to use realm config for this purpose. This results in code that is hard for us to maintain, so I'm afraid we really can't accept this approach. |
How would you envisage the configuration of the "max-age on terms and conditions approval" you mention? We could change the way the whole thing is defined. |
Indeed. I'll remove the periodical task and add the checks during the auth phase. |
It's a non-trivial thing I'm afraid as it would require updating required actions to be configurable like authenticators are. @mposolda wdyt? |
Yes, we don't have configuration at the level of required actions, we have just the configuration at the level of authenticators in the authentication flow. And agree that adding configuration for the required actions would be non-trivial thing. I am not sure if we should rather do it as part of the "Authentication policies" effort instead of introducing "required action configuration" now? |
|
@mposolda with auth policies in mind, perhaps we would just need to allow this PR to configure through realm attributes for now, with an plan to refactor it down the line? |
|
@laskasn are you still interested in working on this issue? For it to reach a mergeable state we'd need:
|
|
@stianst
I am updating the PR! |
@stianst @mposolda @laskasn Once this is settled and an API is place, open an issue at https://github.com/keycloak/keycloak-ui/issues. The UI team will work with you to get this done quickly. |
af97872 to
e15a412
Compare
OK, i removed the UI part, and i am posting an issue on the keycloak-ui team to see how this is going to be implemented in the new UI. Please, note that it looked like this on the old admin console! It was getting enabled only if the "terms and conditions" flag (leftmost one) was "true". |
|
I am thining about the removal you asked @ssilvert of the UI part on the old admin console. Why do you prefer to remove it and not let it there (since it's a deprecated/fallback UI) and just add also the required stuff on the new admin console? |
|
I looked through all the comments. I'm curious if we decided to add editing capabilities to T&C. In addition, should the version control be added? Once we have the final decision, I can come up with some UX solutions for the requirements. |
|
So if I understand correctly, there are really 2 separate use-cases:
@cgeorgilakis Could you confirm that (1) is not sufficient for you and you also need to cover use-case (2) ? For instance, if you can live with (1), it means that administrator will need to update the terms & conditions required action every 12 months to enforce that users will re-approve 10000 them during their next authentication. This is not entirely same like periodic re-acceptance (as also users who accepted yesterday will be asked again today for re-acceptance due version change), but maybe it is sufficient compromise? |
|
One generic question: Are the use-cases for "periodic re-acceptance" or "versioning" specific only to Terms & Conditions? Or do we want them to be applied also for other required actions? I can imagine periodic updates for more actions (Like |
Apply required action to all users immediately could make sense for most required actions. It would be a simple change to the UI in the Authentication section. |
|
I guess it makes sense to plan the UI if we agree on what we want to achieve? I am still not 100% sure if it is clear TBH. Few use-cases come to me, which we might agree on:
I guess that for Milestone 1, we can do this only for Terms & Conditions and then at next stage extend to other required actions? Maybe in tab |
I think this is very good @mposolda. I agree with all of it. The only part that might be a little tricky is figuring out who an "applicable user" is. I guess you would need some sort of callback where you pass the user and ask the required action to decide if the user is "applicable". It's doable though. |
|
@mposolda Sounds like a good plan. However, I agree with @cgeorgilakis that we should let administrators indicate whether a required action should run for users. I'm wondering how the "version property" in a resource bundle/theme would work considering that themes are also deployed as JARs. Looking at the T&C required action, a timestamp is already set for the user. What we need now is to allow administrators to set a global timestamp to compare and check if the action should run again for a particular user (similar to not-before when expiring sessions at the realm level, I think). For now, we could store the global config as a realm attribute ... Or just think about enabling a component model to required actions. |
|
@mposolda @ssilvert @pedroigor I will come up with some designs based on the discussions and decisions. Once I have some deliverables, I will share them with you. |
|
Hi @mposolda @pedroigor , if the admin can configure the T&C, what attributes should be included in the T&C configurations? Does it just include the Reset interval including some number input fileds and time units, like the image shows below? |
|
For now, and based on the discussions, I would say the However, in case you want to force users to accept the T&C when it changes, we need something else. Something along the lines suggested by Stian like a version. As I'm not sure how to deal with a version property, we could have an option to set the "not-before" timestamp. This timestamp will basically invalidate any previous T&C accepted by the user before it and force the user to re-accept the T&C. You don't necessarily need to provide a date/time but just a button that sets this "not-before" timestamp based on the current time. We probably need to show this information to administrators too so that they know the last timestamp set. Makes sense? I see you are also working with the old administration console ... Ideally, you should consider developing on top of the new admin console. I think they have specific components there that can be re-used from authentication flows to configure required actions. |
|
@pedroigor Thanks. What's the deadline for your plan? @laskasn @mposolda @pedroigor @stianst |
|
@xianli123 Not sure. As this is touching the UI (in addition to storing new data to realm/actions) we probably need more discussions to make sure we agree about the solution. I see a lot of benefit on this proposal so it would be nice to have it done before 23. |
@xianli123 I believe this needs a way to select that you want no reset interval. Maybe some sort of enable/disable. |
Thanks @pedroigor Who can help us review the solution and make the final decisions? Is it necessary to have a meeting to discuss the solution? |
@ssilvert Yes. I agree. That's also a use case. |
|
Can users upload or create a term and condition in the UI? The Keycloak documentation mentioned that |
|
@xianli123 Yes, it is possible to upload the text. If you are using our version of ftl files like So, an administrator can go to Realm settings --> Localization and define these from the UI. BTW, I'm not sure where all those messages are used. |
|
@ssilvert I think the message will display on the login page if the admin enables the "Terms and conditions". |
Yeah. Some of those messages are easy to track down. Others take a little more digging to find out what they are for. |
@mposolda yes we want both uses cases. This issue is for use case 1 and this for use case 2. What you describe after can not work in a real environment. Although now we want these only for T&C, I agree that it would be nice to have them for all Required Actions. @xianli123 the previous icon was for reset button in old admin console. @ssilvert has proposed for new admin console:
Finally, T&C can be changed with custom theme ( changing terms.ftl). We use this. |
|
@cgeorgilakis What is the aim of the Reset icon, to refresh the T&C or reset the intervals? |
Refresh T&C. This is from our PR. We could decide the appropriate name. |
So does it mean, "Make all users perform the action on next login."? |
|
@cgeorgilakis Ok. I created a conceptual design as shown in the screen below. I put the configurations on this separate page. Users can configure the T&C in this page. Does it make sense? |
Yes. It looks good. |
|
I am closing this PR as it has already been out there for some time and seems to be stuck in eternal review. We have this tracked under #19275, so we can continue further discussion there. |
Resolves issue:
https://issues.redhat.com/browse/KEYCLOAK-17622