Search code examples
jhipsteruser-management

How to hanlde more user information (Field) With JHipster UAA


I have 2 microservice, 1 registry, 1 gateway and 1 uaa that run made by JHipster. now in first contract with JHipster UAA, I can't understand how to handle more field on user registration?! where user data store?

I know it's on UAA but can't find any entity to add my field that gateway can detect. I guess that field must be added to User class in UAA and then in gateway add Its corresponding fields;

Do you work with Jhipster UAA? Can share your experiment with me? Is there any advance tutorial on it?


Solution

  • there is the straightforward and the recommended way of solving this:

    the direct approach is

    1. add your field to User class
    2. add it also to UserDTO and ManagedUserVM, to make it available at UserResource and AccountResource
    3. apply changes to UserService
    4. add the field to liquibase (src/main/resources/config/liquibase)

    This way is fast, but you break compatibility to upgrade to newer UAA from JHipster, as you overwrite default classes.

    The better approach is, if you add a new entity, say UserAdditionalInfo or something like this, what is in a one-to-one relationship to the user. Here you can add as many fields you want using the entity sub-generator, and still be open to upgrades from JHipster.