use of com.wso2telco.core.userprofile.dto.UserProfileDTO in project core-util by WSO2Telco.
the class JSessionAuthenticationFilter method isAuthenticated.
@Override
public boolean isAuthenticated(ContainerRequestContext requestContext, Method method, String header) {
boolean isExpired = false;
try {
UserProfileCachable cachable = CacheFactory.getInstance(CacheType.LOCAL).getService();
String sessionId = header.replace(AuthFilterParam.JSESSION_ID.getTObject(), "");
isExpired = cachable.isExpired(sessionId);
if (isExpired) {
requestContext.abortWith(accessDenied);
return false;
}
UserProfileDTO userProfileDTO = cachable.get(sessionId);
userName = userProfileDTO.getUserName();
log.debug("username : " + userName);
} catch (BusinessException e) {
requestContext.abortWith(accessDenied);
return false;
}
return true;
}
use of com.wso2telco.core.userprofile.dto.UserProfileDTO in project core-util by WSO2Telco.
the class UserProfileRetriever method fillUserProfileDTO.
private UserProfileDTO fillUserProfileDTO(String userName, UserRoleDTO userRoleDTO, Map<String, Object> uiPermissionTree, UserClaimDTO userClaimDTO) {
UserProfileDTO userProfileDTO = new UserProfileDTO();
userProfileDTO.setUserName(userName);
if (userRoleDTO.getUserRoles() != null) {
userProfileDTO.setUserRoles(userRoleDTO.getUserRoles());
}
if (uiPermissionTree != null) {
userProfileDTO.setUiPermissions(uiPermissionTree);
}
if (userClaimDTO != null) {
userProfileDTO.setFirstName(userClaimDTO.getFirstName());
userProfileDTO.setLastName(userClaimDTO.getLastName());
userProfileDTO.setEmailAddress(userClaimDTO.getEmailAddress());
userProfileDTO.setOrganization(userClaimDTO.getOrganization());
userProfileDTO.setDepartment(userClaimDTO.getDepartment());
}
return userProfileDTO;
}
Aggregations