eosc-kc / keycloak

Open Source Identity and Access Management For Modern Applications and Services
https://www.keycloak.org
Apache License 2.0
4 stars 4 forks source link

Support AUP on-demand renewal #48

Open NicolasLiampotis opened 3 years ago

NicolasLiampotis commented 3 years ago

Realm administrator should be able to update the current Acceptable Use Policy (AUP or Terms & Conditions).

laskasn commented 3 years ago

The first bullet point is currently provided out-of-the-box by keycloak. The second bullet point is a little bit tricky to implement. It requires to have versioning for the Terms & Conditions, yet the current design has no such thing. The login flow just loads a static ftl file (which is translated into html) for the UserRequiredAction of "terms_and_conditions". To modify the Terms and conditions, someone should just replace/modify the ftl file within the theme and maybe add some more css, js and icons (or make another theme with the equivalent files). A possible "hack" would be to introduce incremental version numbers for the UserRequiredActions, along with a hash of the flt contents. But it's still quite unclear to me how i can introduce this feature, changing as few as possible things in keycloak. I'll post an update with a description of changes needed to support the above idea.

laskasn commented 3 years ago

It's really difficult to automatically determine if the Terms and conditions have changed (terms.ftl), because this ftl file might (already) include another ftl on which the changes apply. So it's impossible just by observing the terms.ftl to know. What i suggest is that we should rather enable the admin to batch reset the process for all existing users, by adding a button and the appropriate logic on the server side. The good thing is that the keycloak utilises 2 tables for the Terms and Conditions.

Sensing a change on the terms.ftl file or even more on any included/linked to that files is really hard to do, BUT, manually an admin could reset the values on the table 'user_required_action' to ask all existing users to re-accept his new terms and conditions.

@NicolasLiampotis Please, let me know if the last sentence fulfils our needs. If so, we should open a discussion with keycloak's team to see how we can implement that and get it into the future releases.

NicolasLiampotis commented 3 years ago

Issue description for PR: https://docs.google.com/document/d/1j356lTlNwETiGN-Nwv2urIjsPp9CtZXWDQ4F_ZFgJ8E/edit

laskasn commented 3 years ago

Keycloak issue tracker ticket: https://issues.redhat.com/browse/KEYCLOAK-17379