authorities.addAll(ConvertDomainsToSecurityContext.convertEnMePermission(user.getSecUserPermissions()));
// log.debug("EnMeUserDetails: Authorities size :"+authorities.size());
}
//creating user details
final EnMeUserAccountDetails userDetails = new EnMeUserAccountDetails(
user.getUsername(),
user.getPassword(),
authorities,
user.isUserStatus() == null ? false : user.isUserStatus(),
true, // account not expired
true, // credentials not expired
true, // account not locked
user.getCompleteName() == null ? "" : user.getCompleteName(), // complete name
user.getUserEmail(), // user email
user
);
userDetails.setSocialCredentials(false);
userDetails.setAccountNonExpired(true);
userDetails.setAccountNonLocked(true);
//log.debug("EnMeUserDetails : "+userDetails.toString());
return userDetails;
}