Improve DenableConditionalAuthenticationFeature flag usage
@@ -340,18 +340,18 @@ public class FrameworkUtils {
*/
public static StepBasedSequenceHandler getStepBasedSequenceHandler() {
- StepBasedSequenceHandler stepBasedSequenceHandler = null;
- if (System.getProperty(ENABLE_CONDITIONAL_AUTHENTICATION_FLAG) != null) {
- stepBasedSequenceHandler = new GraphBasedSequenceHandler();
- } else {
+ StepBasedSequenceHandler stepBasedSequenceHandler;
Object obj = ConfigurationFacade.getInstance().getExtensions()
.get(FrameworkConstants.Config.QNAME_EXT_STEP_BASED_SEQ_HANDLER);
-
if (obj instanceof StepBasedSequenceHandler) {
stepBasedSequenceHandler = (StepBasedSequenceHandler) obj;
} else {
stepBasedSequenceHandler = DefaultStepBasedSequenceHandler.getInstance();
}
+
+ if (System.getProperty(ENABLE_CONDITIONAL_AUTHENTICATION_FLAG) != null
+ && !(stepBasedSequenceHandler instanceof GraphBasedSequenceHandler)) {
+ stepBasedSequenceHandler = new GraphBasedSequenceHandler();
}
return stepBasedSequenceHandler;
}
@@ -379,10 +379,7 @@ public class FrameworkUtils {
*/
public static StepHandler getStepHandler() {
- StepHandler stepHandler = null;
- if (System.getProperty(ENABLE_CONDITIONAL_AUTHENTICATION_FLAG) != null) {
- stepHandler = new GraphBasedStepHandler();
- } else {
+ StepHandler stepHandler;
Object obj = ConfigurationFacade.getInstance().getExtensions()
.get(FrameworkConstants.Config.QNAME_EXT_STEP_HANDLER);
if (obj instanceof StepHandler) {
@@ -390,6 +387,10 @@ public class FrameworkUtils {
} else {
stepHandler = DefaultStepHandler.getInstance();
}
+
+ if (System.getProperty(ENABLE_CONDITIONAL_AUTHENTICATION_FLAG) != null
+ && !(stepHandler instanceof GraphBasedStepHandler)) {
+ stepHandler = new GraphBasedStepHandler();
}
return stepHandler;
}
