本文整理汇总了Java中org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig.setOrder方法的典型用法代码示例。如果您正苦于以下问题:Java StepConfig.setOrder方法的具体用法?Java StepConfig.setOrder怎么用?Java StepConfig.setOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig
的用法示例。
在下文中一共展示了StepConfig.setOrder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStepConfigurationObject
import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
private StepConfig createStepConfigurationObject(int stepOrder, AuthenticationStep authenticationStep) {
StepConfig stepConfig = new StepConfig();
stepConfig.setOrder(stepOrder);
stepConfig.setSubjectAttributeStep(authenticationStep.isAttributeStep());
stepConfig.setSubjectIdentifierStep(authenticationStep.isSubjectStep());
return stepConfig;
}
示例2: testHandleLastStep
import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
@Test(dataProvider = "stepData")
public void testHandleLastStep(boolean isRequestAuthenticated,
boolean isOverallAuthenticationSucceeded) throws Exception {
StepHandler stepHandler = getMockedStepHandlerForSuccessfulRequestAuthentication();
mockStatic(FrameworkUtils.class);
when(FrameworkUtils.getStepHandler()).thenReturn(stepHandler);
StepConfig firstStep = new StepConfig();
firstStep.setOrder(1);
// Second step is completed.
StepConfig lastStep = new StepConfig();
lastStep.setOrder(2);
lastStep.setCompleted(true);
SequenceConfig sequenceConfig = new SequenceConfig();
sequenceConfig.getStepMap().put(1, firstStep);
sequenceConfig.getStepMap().put(2, lastStep);
doNothing().when(stepBasedSequenceHandler).handlePostAuthentication(any(HttpServletRequest.class), any
(HttpServletResponse.class), any(AuthenticationContext.class));
// currently we have completed second step
context.setCurrentStep(2);
context.setSequenceConfig(sequenceConfig);
context.setRequestAuthenticated(isRequestAuthenticated);
stepBasedSequenceHandler.handle(request, response, context);
assertResetContext(context);
assertEquals(context.isRequestAuthenticated(), isOverallAuthenticationSucceeded);
assertTrue(context.getSequenceConfig().isCompleted());
}
示例3: testHandlePassiveAuthenticateWhenMultiOptionStep
import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
@Test
public void testHandlePassiveAuthenticateWhenMultiOptionStep() throws Exception {
StepHandler stepHandler = getMockedStepHandlerForSuccessfulRequestAuthentication();
mockStatic(FrameworkUtils.class);
when(FrameworkUtils.getStepHandler()).thenReturn(stepHandler);
StepConfig firstStep = new StepConfig();
firstStep.setOrder(1);
// Second step is completed.
StepConfig lastStep = new StepConfig();
lastStep.setMultiOption(true);
lastStep.setOrder(2);
lastStep.setCompleted(true);
SequenceConfig sequenceConfig = new SequenceConfig();
sequenceConfig.getStepMap().put(1, firstStep);
sequenceConfig.getStepMap().put(2, lastStep);
doNothing().when(stepBasedSequenceHandler).handlePostAuthentication(any(HttpServletRequest.class), any
(HttpServletResponse.class), any(AuthenticationContext.class));
// currently we have completed second step
context.setCurrentStep(2);
context.setSequenceConfig(sequenceConfig);
context.setPassiveAuthenticate(true);
context.setRequestAuthenticated(false);
stepBasedSequenceHandler.handle(request, response, context);
assertResetContext(context);
assertTrue(context.getSequenceConfig().isCompleted());
assertFalse(context.getSequenceConfig().getStepMap().get(context.getCurrentStep()).isRetrying());
}
示例4: processStepElement
import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
/**
* Create StepDOs for each step entry
*
* @param stepElem
* @return
*/
private StepConfig processStepElement(OMElement stepElem) {
StepConfig stepConfig = new StepConfig();
OMAttribute loginPageAttr = stepElem.getAttribute(new QName(FrameworkConstants.Config.ATTR_STEP_LOGIN_PAGE));
if (loginPageAttr != null) {
stepConfig.setLoginPage(loginPageAttr.getAttributeValue());
}
OMAttribute orderAttr = stepElem.getAttribute(new QName(FrameworkConstants.Config.ATTR_STEP_ORDER));
if (orderAttr == null) {
log.warn("Each Step Configuration should have an order. +"
+ "Authenticators under this Step will not be registered.");
return null;
}
stepConfig.setOrder(Integer.parseInt(orderAttr.getAttributeValue()));
for (Iterator authenticatorElements = stepElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTHENTICATOR);
authenticatorElements.hasNext(); ) {
OMElement authenticatorElem = (OMElement) authenticatorElements.next();
String authenticatorName = authenticatorElem.getAttributeValue(new QName(FrameworkConstants.Config.ATTR_AUTHENTICATOR_NAME));
AuthenticatorConfig authenticatorConfig = authenticatorConfigMap.get(authenticatorName);
String idps = authenticatorElem.getAttributeValue(new QName(FrameworkConstants.Config.ATTR_AUTHENTICATOR_IDPS));
//if idps defined
if (idps != null && !idps.isEmpty()) {
String[] idpArr = idps.split(",");
for (String idp : idpArr) {
authenticatorConfig.getIdpNames().add(idp);
}
} else {
authenticatorConfig.getIdpNames().add(FrameworkConstants.LOCAL_IDP_NAME);
}
stepConfig.getAuthenticatorList().add(authenticatorConfig);
}
return stepConfig;
}
示例5: testHandleMultiOptionStep
import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
@Test
public void testHandleMultiOptionStep() throws Exception {
StepHandler stepHandler = getMockedStepHandlerForIncompleteStep(true);
mockStatic(FrameworkUtils.class);
when(FrameworkUtils.getStepHandler()).thenReturn(stepHandler);
StepConfig firstStep = new StepConfig();
firstStep.setOrder(1);
// Second step is completed.
StepConfig lastStep = new StepConfig();
lastStep.setMultiOption(true);
lastStep.setOrder(2);
lastStep.setCompleted(true);
SequenceConfig sequenceConfig = new SequenceConfig();
sequenceConfig.getStepMap().put(1, firstStep);
sequenceConfig.getStepMap().put(2, lastStep);
doNothing().when(stepBasedSequenceHandler).handlePostAuthentication(any(HttpServletRequest.class), any
(HttpServletResponse.class), any(AuthenticationContext.class));
// currently we have completed second step
context.setCurrentStep(2);
context.setSequenceConfig(sequenceConfig);
context.setRequestAuthenticated(false);
stepBasedSequenceHandler.handle(request, response, context);
assertResetContext(context);
// Assert whether the sequence is retrying the step
assertTrue(context.getSequenceConfig().getStepMap().get(context.getCurrentStep()).isRetrying());
// Assert whether before retrying the context request authentication status was set to true.
assertTrue(context.isRequestAuthenticated());
// step handler completes the step successfully
stepHandler = getMockedStepHandlerForSuccessfulRequestAuthentication();
when(FrameworkUtils.getStepHandler()).thenReturn(stepHandler);
stepBasedSequenceHandler.handle(request, response, context);
assertTrue(context.getSequenceConfig().isCompleted());
assertTrue(context.isRequestAuthenticated());
}