<div dir="ltr">You can use option 1. Create your own user provider, inside the provider lookup the JPA provider and delegate to that, but create a wrapper that encrypts/decrypts the personal details.<div><br></div><div>Just to point out that the User SPI is currently being reworked and you would most likely have to do some refactoring once it is ready, which should be in a month or two.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 June 2016 at 20:35, Aaron Harnly <span dir="ltr"><<a href="mailto:aharnly@amplify.com" target="_blank">aharnly@amplify.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi there,<div><br></div><div>I'm on Day 1 of looking at Keycloak, although some colleagues have been using it successfully. Please forgive the naiveté of the question, but I'd love confirmation that I'm on the right track.</div><div><br></div><div>I'd like to ensure that user email addresses, names, and usernames are encrypted by the KeyCloak application before persisting to a relational store.</div><div><br></div><div>org.keycloak.models.jpa.entities.UserEntity is pretty obviously the place to do that – the natural question is, what is the best way for me to provide a slightly customized UserEntity.java in which I can do my desired encryption/decryption?<br></div><div><br></div><div>My initial scan of docs and repo suggests one of the following:</div><div><br></div><div>1) Create a UserProvider analogous to the JpaUserProvider, but with my own UserEntity subclass.</div><div>2) If needed, follow the approach described in this thread[1] from November to implement a custom Hibernate EntityManager, but I don't think that's necessary for my case, and don't yet fully understand that.</div><div>3) Something else.</div><div><br></div><div>[1] <a href="http://lists.jboss.org/pipermail/keycloak-dev/2015-November/005745.html" target="_blank">http://lists.jboss.org/pipermail/keycloak-dev/2015-November/005745.html</a><br></div><div><br></div><div>Thoughts or advice appreciated!</div><span class="HOEnZb"><font color="#888888"><div>Aaron<br></div><div><br></div><div><br></div></font></span></div>
<br>_______________________________________________<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></blockquote></div><br></div>