0 Replies Latest reply on Oct 12, 2018 11:05 AM by peter craddock

    Example of how to create a password for use in properties-realm

    peter craddock Novice

      I can create a password via the add-user.sh file

       

      I have created my realm and I would like to be able to populate the properties file myself programatically

       

                  <properties-realm groups-attribute="groups" name="absPropRealm">

                     <users-properties path="abs-users.properties" plain-text="true" relative-to="jboss.server.config.dir"/>

                     <groups-properties path="abs-roles.properties" relative-to="jboss.server.config.dir"/>

                  </properties-realm>

       

      I can create a Password but how can I write this to the props file or get the value as a string so I can add it myself ?

       

      Security.addProvider(new WildFlyElytronProvider());

      PasswordFactory factory = PasswordFactory.getInstance(DigestPassword.ALGORITHM_DIGEST_MD5);

       

      DigestPasswordSpec spec = new DigestPasswordSpec(user, domain, pDecrypt);

      Object o = factory.generatePassword(spec)