I'm not 100% sure if this is a bug on Keycloak, but after a user is
successfully authenticated the method ".getUserPrincipal" returns null. This is what I've been trying to do.
I saw an issue reported with old versions of Resteasy, but the NPE persists even after upgrade the project to the latest version. The issue was tested against jboss-as-7.1.1.Final.