<div dir="ltr"><div>OK; I hear you. <br><br></div><div>I do believe, however, that the things above - and quite a few other things - are really required to get <br>the usability of an "Out Of The Box" product. Let me suggest some things below:<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-13 20:47 GMT+02:00 Bill Burke <span dir="ltr"><<a href="mailto:bburke@redhat.com" target="_blank">bburke@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 8/13/2015 2:18 PM, Lennart Jörelid wrote:<br>
> [Forwarding to the list; not meant as a personal reply.]<br>
><br>
> Hello there,<br>
><br>
> This is exacly what I am struggling with at the moment. I have found a<br>
> number of things which would need clarification in documentation as well<br>
> as in examples:<br>
><br>
</span>> 1. *Custom user data properties/fields*. It seems that one has to/ought<br>
<span class="">> to add custom properties to three places in the theme files:<br>
> account, admin and registration. However, the ways to add them<br>
> differ greatly, as each FTL template structure is quite different.<br>
> (Account uses account.ftl; Admin uses<br>
> partials/user-attribute-entry.ftl). Pattern definitions and<br>
> explanations are missing from examples and documentation, as far as<br>
> I can tell.<br>
<br>
</span>Stian wants a generic service. I disagree because I don't think it will<br>
be used. I just look at <a href="http://developers.redhat.com" rel="noreferrer" target="_blank">developers.redhat.com</a> for example, and they<br>
have differing formatting requirements. You would end up recreating cSS<br>
and HTML within the admin console. Not something I'm kean on doing.<br></blockquote><div><br></div><div>This is a tricky task to create in a simple manner; I agree with that. <br></div><div>The model and view could be created separately, and joined to a result using DI. So ... <br><ol><li><b>Model - from a Dev perspective</b>: Defining entity classes (JPA and JAXB to combine storage and transport) is pretty common for developers, as is extending specified interfaces. If you simplify the model for users to a standard Entity and include a setter/getter pair for something which is an interface (instead of today's mapping between unvalidateable string and unvalidateable string), developers can simply implement their own custom metadata class which can include Validation on any of the fields - not only passwords. Today, we cannot validate the content of any custom properties, as they are stored as Strings.<br></li><li><b>Model - from a Non-Dev perspective</b>: Non-developers require quite a lot of tooling to create the model classes. Is it your idea of an "Out of the Box" solution that non-devs should be able to define the custom properties of each user? If so, I believe that the "generate-the-model" tooling is currently missing from the codebase.<br></li><li><b>Model - performance: </b>The current solution ought to give really poor performance when the number of users in the keycloak database rises; the JPA implementation of custom attributes stashes all of them in a single table with a String containing an UUID for primary key... at least with an integer, custom attributes for a single user will be stored at similar locations. Your UUID approach guarantees that each user attribtue is scattered evenly across the table, and re-indexing will happen every time a new value is inserted. There are quite a few other options to implement this functionality that would improve performance compared to the current solution - but these require some form of development backround from a user. Which approach will KeyCloak take? <br></li><li><b>View - from a Dev perspective</b>: We architects and developers like standards that we have encountered before, and creating a complete theme with the level of control you envision above is, quite frankly, <i>really difficult</i> today. Not only is the documentation lacking on theme basic semantics, but you need to understand how quite a lot of fragments are joined together by Freemarker to a live page. While Freemarker is not unheard of, it is an oddball (i.e. not part of the standard JavaEE platform). <br></li><li><b>View - usability</b>: Usability is king. If you would like to improve usability for people trying to create custom user properties, I believe that you must use standard JavaScript frameworks or JavaEE tech. A suggestion: create a KeyCloak AngularJS module which contains a set of custom directives - this implies that users can create complete pages containing keycloak-specific tags. This implies that we can see all views in a theme, including the directives for custom attributes. I believe this would be considerably simpler than understanding which Freemarker fragments are used in a particular use case, as is the case today. With improved usability comes reduced burden of documentation, which should please quite a lot of you KeyCloak devs.</li><li><b>View - conclusion:</b> I don't think that today's freemarker approach works - and while I can certainly create another ProviderFactory than the Freemarker one, I don't know the end result which I should target. What pages should be done, and in which order are they called?<br></li></ol></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> 2. *Editable properties per role*. Realm admins/editors could perhaps<br>
<span class="">> be able to edit all properties (except primary key/ID value) for all<br>
> the users in a realm - but we would typically like to restrict which<br>
> properties (both basic and custom attributes) are editable depending<br>
> on the roles/privileges a user has in the realm. (For example, it<br>
> would likely be a bad ide to permit users to change their names and<br>
> birthday arbitrarily after registration). How do we restrict<br>
> editability of normaly and custom user properteis - both in terms of<br>
> the data and the forms required to interact with keycloak? Pattern<br>
> definitions and explanations are missing from examples and<br>
> documentation, as far as I can tell.<br>
<br>
</span>We don't have a way to do this in the account service yet. You can<br>
modify the forms to display whatever you want, but a rogue user would be<br>
able to modify any attribute they wanted. Ugh, we probably need to fix<br>
this.<br></blockquote><div><br></div><div>I think that this is core functionality, if KeyCloak should really work as an out-of-the-box solution.<br></div><div>In particular, since you folks have taken the approach that KeyCloak should hold a set of base <br>properties for each user, and supply means to extend those base properties with custom properties.<br><br></div><div>This means that using KeyCloak should really imply 3 initial steps after installation:<br><br></div><div><ol><li>Define your set of custom user properties. <br></li><li>Create a theme in order to be able to handle your custom user properties (store, manage, etc.)</li><li>Migrate (or Federate) all users from the current IDM database/application to KeyCloak. This means that it must be a trivial (and well-example'd/well-documented) task to develop a Class which reads the currnet IDM data and makes instances of KeyCloak UserModel instances, including all its extra properties. <br></li></ol></div><div>This means that the KeyCloak documentation must walk users/developers through these steps. In some detail. Right?<br></div> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> 3. *Linking users to roles/privileges in other realms.* How should one<br>
<span class="">> construct realms to grant roles & privileges automatically to users<br>
> in other realms? (For example: All Users in Literary Society A can<br>
> register for a party hosted by Literary Society B. Hence, how does<br>
> realm admin B grant role KnownGuest to all users in realm A, to<br>
> permit them to access Society B's register-to-the-event-page?<br>
> Assume, of course, that both A and B are managed by the same<br>
> Keycloak DB, so basic identity attributes should be extracted<br>
> normally from Keycloak. Neither realm admins from A or B have master<br>
> realm access.) Pattern definitions and explanations are missing from<br>
> examples and documentation, as far as I can tell.<br>
><br>
<br>
</span>I don't think we'll ever have the ability to link realms. If we did<br>
ever add it it would be next year. Too much in queue at the moment.<span class="im HOEnZb"><br></span></blockquote><div><br></div><div>Hm. This feasture is really important to me.<br></div><div>I can certainly summon up some JIRAs for it, and suggest some compliant solution and PRs.<br></div><div>If you wish, ping me on Skype to discuss.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="im HOEnZb">
--<br>
Bill Burke<br>
JBoss, a division of Red Hat<br>
<a href="http://bill.burkecentral.com" rel="noreferrer" target="_blank">http://bill.burkecentral.com</a><br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><span style="font-family:monospace;font-size:medium"><pre>--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: <a href="mailto:lj@jguru.se" target="_blank">lj@jguru.se</a>
| URL: <a href="http://www.jguru.se" target="_blank">www.jguru.se</a>
| Phone
| (skype): jgurueurope
| (intl): +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+</pre></span></div>
</div></div>