@dasniko thanks for the reply! So basically we just create some separate PUT endpoint that will, within Keycloak, get all the users and add Required Actions to these available users? In this way, our apps will call Keycloak only once instead of the apps iterating users and making multiple request to Keycloak’s endpoint making it little more efficient?
If yes, I was looking at this post
Is some sort of sudo code like below a right approach in my custom endpoint?
// Fetch all users in the realm
List<UserModel> users = session.users().getUsers(realm);
// Add the required action to each user
for (UserModel user : users) {
user.addRequiredAction(UserModel.RequiredAction.TERMS_AND_CONDITIONS);
}
would work?