use of password.pwm.http.bean.PwmSessionBean in project pwm by pwm-project.
the class CryptoRequestBeanImpl method getSessionStateInfo.
@Override
public String getSessionStateInfo(final PwmRequest pwmRequest) throws PwmUnrecoverableException {
final SecureService secureService = pwmRequest.getPwmApplication().getSecureService();
final Map<Class, PwmSessionBean> cachedMap = (Map<Class, PwmSessionBean>) pwmRequest.getHttpServletRequest().getAttribute(attrName);
if (cachedMap == null || cachedMap.isEmpty()) {
return "";
}
if (cachedMap.size() > 1) {
throw new IllegalStateException("unable to handle multiple session state beans");
}
final PwmSessionBean bean = cachedMap.values().iterator().next();
return secureService.encryptObjectToString(bean);
}
Aggregations