use of org.wso2.carbon.identity.user.rename.core.dto.UserDTO in project carbon-identity-framework by wso2.
the class AuthenticationEndpointUtil method getUser.
/**
* Build user object from complete username
* @param userName
* @return
*/
public static UserDTO getUser(String userName) {
if (userName == null) {
return null;
}
String userStoreDomain = extractDomainFromName(userName);
String tenantDomain = MultitenantUtils.getTenantDomain(userName);
String userNameWithoutTenantDomainAndUserStoreDomain = MultitenantUtils.getTenantAwareUsername(UserCoreUtil.removeDomainFromName(userName));
UserDTO user = new UserDTO();
user.setUsername(userNameWithoutTenantDomainAndUserStoreDomain);
user.setRealm(userStoreDomain);
user.setTenantDomain(tenantDomain);
return user;
}
use of org.wso2.carbon.identity.user.rename.core.dto.UserDTO in project carbon-identity-framework by wso2.
the class UserRegistrationAdminServiceClient method addUser.
/**
* Add new user.
*
* @param username Username of the user.
* @param password Password of the user.
* @param userFields User fields to be updated.
* @throws java.rmi.RemoteException
* @throws UserRegistrationAdminServiceException
*/
public void addUser(String username, char[] password, List<UserFieldDTO> userFields) throws RemoteException, UserRegistrationAdminServiceException {
UserDTO userDTO = new UserDTO();
userDTO.setUserName(username);
userDTO.setPassword(new String(password));
userDTO.setUserFields(userFields.toArray(new UserFieldDTO[userFields.size()]));
stub.addUser(userDTO);
}
use of org.wso2.carbon.identity.user.rename.core.dto.UserDTO in project identity-governance by wso2-extensions.
the class RecoverPasswordApiServiceImplTest method buildUserDTO.
private UserDTO buildUserDTO() {
UserDTO userDTO = new UserDTO();
userDTO.setUsername("dummy");
return userDTO;
}
use of org.wso2.carbon.identity.user.rename.core.dto.UserDTO in project identity-governance by wso2-extensions.
the class MeApiServiceImpl method getUser.
/**
* Form UserDTO using username and tenant from context.
*
* @return userDTO.
*/
private UserDTO getUser() {
String usernameFromContext = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
String tenantFromContext = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
UserDTO userDTO = new UserDTO();
userDTO.setUsername(UserCoreUtil.removeDomainFromName(usernameFromContext));
userDTO.setRealm(UserCoreUtil.extractDomainFromName(usernameFromContext));
userDTO.setTenantDomain(tenantFromContext);
return userDTO;
}
use of org.wso2.carbon.identity.user.rename.core.dto.UserDTO in project identity-governance by wso2-extensions.
the class RecoveryUtil method getUserDTO.
public static UserDTO getUserDTO(User user) {
UserDTO userDTO = new UserDTO();
if (user == null) {
return userDTO;
}
userDTO.setTenantDomain(user.getTenantDomain());
if (StringUtils.isNotBlank(user.getUserStoreDomain())) {
userDTO.setRealm(user.getUserStoreDomain());
} else {
userDTO.setRealm(IdentityUtil.getPrimaryDomainName());
}
userDTO.setUsername(user.getUserName());
return userDTO;
}
Aggregations