Search in sources :

Example 11 with ChallengeSet

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);
        }
    }
}
Also used : ChallengeSet(com.novell.ldapchai.cr.ChallengeSet) ChallengeProfile(password.pwm.config.profile.ChallengeProfile) SetupResponsesBean(password.pwm.http.bean.SetupResponsesBean)

Aggregations

ChallengeSet (com.novell.ldapchai.cr.ChallengeSet)11 ChaiChallengeSet (com.novell.ldapchai.cr.ChaiChallengeSet)4 Challenge (com.novell.ldapchai.cr.Challenge)4 ResponseSet (com.novell.ldapchai.cr.ResponseSet)4 ChallengeProfile (password.pwm.config.profile.ChallengeProfile)4 ErrorInformation (password.pwm.error.ErrorInformation)4 ChaiUser (com.novell.ldapchai.ChaiUser)3 ArrayList (java.util.ArrayList)3 PwmUnrecoverableException (password.pwm.error.PwmUnrecoverableException)3 ChaiChallenge (com.novell.ldapchai.cr.ChaiChallenge)2 ChaiException (com.novell.ldapchai.exception.ChaiException)2 ChaiOperationException (com.novell.ldapchai.exception.ChaiOperationException)2 ChaiValidationException (com.novell.ldapchai.exception.ChaiValidationException)2 List (java.util.List)2 Locale (java.util.Locale)2 PwmApplication (password.pwm.PwmApplication)2 FormConfiguration (password.pwm.config.value.data.FormConfiguration)2 PwmDataValidationException (password.pwm.error.PwmDataValidationException)2 ForgottenPasswordBean (password.pwm.http.bean.ForgottenPasswordBean)2 SetupResponsesBean (password.pwm.http.bean.SetupResponsesBean)2