use of com.wso2telco.core.userprofile.cache.UserProfileCachable 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;
}
Aggregations