use of com.novell.ldapchai.cr.ChallengeSet in project pwm by pwm-project.
the class SetupResponsesServlet method initializeBean.
private void initializeBean(final PwmRequest pwmRequest, final SetupResponsesBean setupResponsesBean) throws PwmUnrecoverableException {
if (pwmRequest.getPwmSession().getUserInfo().getResponseInfoBean() != null) {
setupResponsesBean.setHasExistingResponses(true);
}
final ChallengeProfile challengeProfile = pwmRequest.getPwmSession().getUserInfo().getChallengeProfile();
if (setupResponsesBean.getResponseData() == null) {
// setup user challenge data
final ChallengeSet userChallengeSet = challengeProfile.getChallengeSet();
final int minRandomSetup = challengeProfile.getMinRandomSetup();
final SetupResponsesBean.SetupData userSetupData = populateSetupData(userChallengeSet, minRandomSetup);
setupResponsesBean.setResponseData(userSetupData);
}
if (setupResponsesBean.getHelpdeskResponseData() == null) {
// setup helpdesk challenge data
final ChallengeSet helpdeskChallengeSet = challengeProfile.getHelpdeskChallengeSet();
if (helpdeskChallengeSet == null) {
setupResponsesBean.setHelpdeskResponseData(new SetupResponsesBean.SetupData());
} else {
final int minRandomHelpdeskSetup = challengeProfile.getMinHelpdeskRandomsSetup();
final SetupResponsesBean.SetupData helpdeskSetupData = populateSetupData(helpdeskChallengeSet, minRandomHelpdeskSetup);
setupResponsesBean.setHelpdeskResponseData(helpdeskSetupData);
}
}
}
Aggregations