[java-identity-provider COMMIT] in /branches/3.3: ./ idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/Trans...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Mar 7 20:36:19 EST 2017
Author: scantor
Date: Tue Mar 7 20:36:19 2017
New Revision: 8660
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8660&view=rev
Log:
BPr8582 - IDP-1098 - C14n failure glitch during MFA transition
Modified:
branches/3.3/ (props changed)
branches/3.3/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java
Modified: branches/3.3/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java
URL: http://svn.shibboleth.net/view/java-identity-provider/branches/3.3/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java?rev=8660&r1=8659&r2=8660&view=diff
==============================================================================
--- branches/3.3/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java (original)
+++ branches/3.3/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java Tue Mar 7 20:36:19 2017
@@ -169,7 +169,9 @@
return true;
}
-
+
+
+// Checkstyle: CyclomaticComplexity OFF
/** {@inheritDoc} */
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
@@ -177,13 +179,23 @@
// Swap MFA flow back into top-level context so that other components see only MFA flow.
authenticationContext.setAttemptedFlow(mfaContext.getAuthenticationFlowDescriptor());
-
+
+ // Event transitions require normalizing empty/null events into "proceed".
+ final EventContext eventCtx = eventContextLookupStrategy.apply(profileRequestContext);
+ final String previousEvent = eventCtx != null && eventCtx.getEvent() != null
+ ? eventCtx.getEvent().toString() : EventIds.PROCEED_EVENT_ID;
+
// Check for an authentication result and move it into the MFA context.
final AuthenticationResult result = authenticationContext.getAuthenticationResult();
if (result != null) {
- log.debug("{} Preserving authentication result from '{}' flow", getLogPrefix(),
- result.getAuthenticationFlowId());
- mfaContext.getActiveResults().put(result.getAuthenticationFlowId(), result);
+ if (EventIds.PROCEED_EVENT_ID.equals(previousEvent)) {
+ log.debug("{} Preserving authentication result from '{}' flow", getLogPrefix(),
+ result.getAuthenticationFlowId());
+ mfaContext.getActiveResults().put(result.getAuthenticationFlowId(), result);
+ } else {
+ log.debug("{} Discarding incomplete authentication result from '{}' flow", getLogPrefix(),
+ result.getAuthenticationFlowId());
+ }
authenticationContext.setAuthenticationResult(null);
}
@@ -197,11 +209,6 @@
log.debug("{} Applying MFA transition rule to exit state '{}'", getLogPrefix(), prevFlowId);
}
- // Event transitions require normalizing empty/null events into "proceed".
- final EventContext eventCtx = eventContextLookupStrategy.apply(profileRequestContext);
- final String previousEvent = eventCtx != null && eventCtx.getEvent() != null
- ? eventCtx.getEvent().toString() : EventIds.PROCEED_EVENT_ID;
-
String flowId = null;
final MultiFactorAuthenticationTransition transition = mfaContext.getTransitionMap().get(prevFlowId);
if (transition != null) {
@@ -224,6 +231,7 @@
}
}
}
+// Checkstyle: CyclomaticComplexity ON
// Checkstyle: CyclomaticComplexity|ReturnCount OFF
/**
More information about the commits
mailing list