use of password.pwm.http.state.SessionStateService in project pwm by pwm-project.
the class PwmFormIDTag method buildPwmFormID.
private static String buildPwmFormID(final PwmRequest pwmRequest) throws PwmUnrecoverableException {
if (pwmRequest == null || pwmRequest.getPwmApplication() == null) {
return "";
}
final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
if (pwmApplication == null) {
return "";
}
final SessionStateService sessionStateService = pwmApplication.getSessionStateService();
final String value = sessionStateService.getSessionStateInfo(pwmRequest);
final FormNonce formID = new FormNonce(pwmRequest.getPwmSession().getLoginInfoBean().getGuid(), Instant.now(), pwmRequest.getPwmSession().getLoginInfoBean().getReqCounter(), value);
return pwmRequest.getPwmApplication().getSecureService().encryptObjectToString(formID);
}
Aggregations