Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
import java.util.Set; import org.joget.apps.app.service.AppUtil; import org.joget.commons.util.SecurityUtil; import org.joget.directory.dao.UserDao; import org.joget.directory.dao.RoleDao; import org.joget.directory.model.User; import org.joget.directory.model.service.DirectoryUtil; import org.joget.directory.model.service.UserSecurity; UserSecurity us = DirectoryUtil.getUserSecurity(); UserDao userDao = (UserDao) AppUtil.getApplicationContext().getBean("userDao"); RoleDao roleDao = (RoleDao) AppUtil.getApplicationContext().getBean("roleDao"); //Create an User User user = new User(); user.setId("testuser"); user.setUsername("testuser"); user.setTimeZone("0"); user.setActive(1); user.setFirstName("Test User"); if (us != null) { user.setPassword(us.encryptPassword("testuser", "password")); } else { user.setPassword(StringUtil.md5Base16("password")); } user.setConfirmPassword("password"); //set role Set roleSet = new HashSet(); roleSet.add(roleDao.getRole("ROLE_USER")); user.setRoles(roleSet); userDao.addUser(user); if (us != null) { us.insertUserPostProcessing(user); }
public java.lang.String getPropertyOptions()
Get JSON property options to embed into the property options of Directory Manager Plugin
public void setProperties(java.util.Map<java.lang.String, java.lang.Object> properties)
Set properties to use in User Security Implementation
public java.util.Map<java.lang.String, java.lang.Object> getProperties()
Get properties to use in User Security Implementation
public java.lang.Boolean getDisableHashLogin()
Disable Hash Login?
public java.lang.Boolean getAllowSessionTimeout()
Allow Session Timeout?
public java.lang.Boolean getForceSessionTimeout()
Force Session Timeout?
public java.lang.Boolean getAuthenticateAllApi()
Authenticate all API?
public java.lang.String encryptPassword (java.lang.String username, java.lang.String password)
Encrypt Password with custom methodology
public java.lang.Boolean verifyPassword (org.joget.directory.model.User user, java.lang.String password)
Verify Password with custom methodology.
public java.util.Collection<java.lang.String> passwordPolicies ()
To get a set of password policies to display in user profile form.
public java.util.Collection<java.lang.String> validatePassword (java.lang.String username, java.lang.String oldPassword, java.lang.String newPassword, java.lang.String confirmPassword)
To validate password format and validity.
Return Collection of error message String.
public java.util.Collection<java.lang.String> validateUserOnInsert(org.joget.directory.model.User user)
To validate user before insert to database
Return Collection of error message String.
public java.util.Collection<java.lang.String> validateUserOnUpdate(org.joget.directory.model.User user)
To validate user before updating
Return Collection of error message String.
public java.util.Collection<java.lang.String> validateUserOnProfileUpdate(org.joget.directory.model.User user)
To validate user before updating profile
Return Collection of error message String.
public void insertUserPostProcessing(org.joget.directory.model.User user)
Processing after a user is added.
public void updateUserPostProcessing(org.joget.directory.model.User user)
Processing after a user is modified.
public void updateUserProfilePostProcessing(org.joget.directory.model.User user)
Processing after a user profile is updated.
public void passwordResetPostProcessing(org.joget.directory.model.User user)
Processing after a user password is reset.
public void deleteUserPostProcessing(java.lang.String username)
Processing after a user is deleted.
public java.lang.String getLoginFormFooter()
HTML to add below login form
public java.lang.String getUserCreationFormFooter()
HTML to add below user creation form
public java.lang.String getUserEditingFormFooter(org.joget.directory.model.User user)
HTML to add below user editing form
public java.lang.String getUserProfileFooter(org.joget.directory.model.User user)
HTML to add below user profile form
public java.lang.String getUserDetailsButtons(org.joget.directory.model.User user)
HTML to extend user details page button
public void loginPreProcessing(org.joget.directory.model.User user, java.lang.String password)
Processing before user login authentication
public void loginPostProcessing(org.joget.directory.model.User user, java.lang.String password, java.lang.Boolean loggedIn)
Processing after user login authentication.
public void requestPostProcessing()
Processing after HTTP Request Completed.
public boolean isDataExist(java.lang.String username)
Check whether a custom security data is exist for a user.