Search in sources :

Example 1 with SessionStateService

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);
}
Also used : PwmApplication(password.pwm.PwmApplication) SessionStateService(password.pwm.http.state.SessionStateService) FormNonce(password.pwm.bean.FormNonce)

Aggregations

PwmApplication (password.pwm.PwmApplication)1 FormNonce (password.pwm.bean.FormNonce)1 SessionStateService (password.pwm.http.state.SessionStateService)1