Display all users in user account page

I want to display all user present in a realm to certain users with query users right. That is some users in a realm have custom roles which allow them query, edit users present in that realm. I want to display all users registered in the realm on the login page of these users. I can edit the ftl theme of account in keycloak to make the visual changes but how to get the data. The realm and account object are accessible in the ftl file. How can i get the attributes present in the realm/account object. Also how i pass other objects to the ftl file.

I have written a node app which does this but over there it could be done by hitting different endpoints and using the access token. How to do it in keycloak interface itself??

I you could help me with the object attributes and how to pass different object to a ftl that would be quite helpful too.