Class TextConfigurationRealm

    • Method Detail

      • setUserDefinitions

        public void setUserDefinitions​(String userDefinitions)

        Sets a newline (\n) delimited String that defines user-to-password-and-role(s) key/value pairs according to the following format:

        username = password, role1, role2,...

        Here are some examples of what these lines might look like:

        root = reallyHardToGuessPassword, administrator
        jsmith = jsmithsPassword, manager, engineer, employee
        abrown = abrownsPassword, qa, employee
        djones = djonesPassword, qa, contractor
        guest = guestPassword

        userDefinitions - the user definitions to be parsed and converted to Map.Entry elements
      • setRoleDefinitions

        public void setRoleDefinitions​(String roleDefinitions)
        Sets a newline (\n) delimited String that defines role-to-permission definitions.

        Each line within the string must define a role-to-permission(s) key/value mapping with the equals character signifies the key/value separation, like so:

        rolename = permissionDefinition1, permissionDefinition2, ...

        where permissionDefinition is an arbitrary String, but must people will want to use Strings that conform to the WildcardPermission format for ease of use and flexibility. Note that if an individual permissionDefinition needs to be internally comma-delimited (e.g. printer:5thFloor:print,info), you will need to surround that definition with double quotes (") to avoid parsing errors (e.g. "printer:5thFloor:print,info").

        NOTE: if you have roles that don't require permission associations, don't include them in this definition - just defining the role name in the userDefinitions is enough to create the role if it does not yet exist. This property is really only for configuring realms that have one or more assigned Permission.

        roleDefinitions - the role definitions to be parsed at initialization