[java-identity-provider COMMIT] in /trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn: AbstractUsernamePassw...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Sep 25 17:42:49 EDT 2015
Author: scantor
Date: Fri Sep 25 17:42:48 2015
New Revision: 7782
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7782&view=rev
Log:
Move up check for attempted flow into top-level base class.
Modified:
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordValidationAction.java
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java
Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordValidationAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordValidationAction.java?rev=7782&r1=7781&r2=7782&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordValidationAction.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordValidationAction.java Fri Sep 25 17:42:48 2015
@@ -27,8 +27,6 @@
import net.shibboleth.idp.authn.principal.UsernamePrincipal;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
-import org.opensaml.profile.action.ActionSupport;
-import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -38,11 +36,9 @@
* {@link net.shibboleth.idp.authn.AuthenticationResult} based on that identity by invoking
* a subclass method.
*
- * @event {@link EventIds#PROCEED_EVENT_ID}
- * @event {@link EventIds#INVALID_PROFILE_CTX}
+ * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
* @event {@link AuthnEventIds#INVALID_CREDENTIALS}
* @event {@link AuthnEventIds#NO_CREDENTIALS}
- * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null</pre>
* @post If AuthenticationContext.getSubcontext(UsernamePasswordContext.class) != null, then
* an {@link net.shibboleth.idp.authn.AuthenticationResult} is saved to the {@link AuthenticationContext} on a
* successful login. On a failed login, the
@@ -97,13 +93,7 @@
if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
return false;
}
-
- if (authenticationContext.getAttemptedFlow() == null) {
- log.info("{} No attempted flow within authentication context", getLogPrefix());
- ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
- return false;
- }
-
+
upContext = authenticationContext.getSubcontext(UsernamePasswordContext.class);
if (upContext == null) {
log.info("{} No UsernamePasswordContext available within authentication context", getLogPrefix());
Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java?rev=7782&r1=7781&r2=7782&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java Fri Sep 25 17:42:48 2015
@@ -46,6 +46,7 @@
import net.shibboleth.utilities.java.support.logic.Constraint;
import org.opensaml.profile.action.ActionSupport;
+import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,7 +67,9 @@
* @param <InboundMessageType> type of in-bound message
* @param <OutboundMessageType> type of out-bound message
*
+ * @event {@link EventIds#INVALID_PROFILE_CTX}
* @event {@link AuthnEventIds#REQUEST_UNSUPPORTED}
+ * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null</pre>
*/
public abstract class AbstractValidationAction<InboundMessageType, OutboundMessageType>
extends AbstractAuthenticationAction<InboundMessageType, OutboundMessageType>
@@ -239,8 +242,12 @@
if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
return false;
- }
-
+ } else if (authenticationContext.getAttemptedFlow() == null) {
+ log.info("{} No attempted flow within authentication context", getLogPrefix());
+ ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
+ return false;
+ }
+
if (clearErrorContext) {
authenticationContext.removeSubcontext(AuthenticationErrorContext.class);
}
More information about the commits
mailing list