[java-identity-provider COMMIT] in /trunk: idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAct...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Dec 9 16:40:54 EST 2013
Author: scantor
Date: Mon Dec 9 16:40:53 2013
New Revision: 5010
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5010&view=rev
Log:
Redesign event handling for classified error conditions so the label becomes the event.
Modified:
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthnEventIds.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAAS.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstLDAP.java
trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAASTest.java
trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstLDAPTest.java
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=5010&r1=5009&r2=5010&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 Mon Dec 9 16:40:53 2013
@@ -169,6 +169,7 @@
}
/** {@inheritDoc} */
+ @Override
protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext,
@Nonnull final AuthenticationContext authenticationContext) throws AuthenticationException {
@@ -209,7 +210,7 @@
authenticationContext.removeSubcontext(AuthenticationErrorContext.class);
}
- return true;
+ return super.doPreExecute(profileRequestContext, authenticationContext);
}
/**
@@ -261,15 +262,17 @@
/**
* Adds an exception encountered during the action to an {@link AuthenticationErrorContext}, creating one if
- * necessary, beneath the {@link AuthenticationContext}, and uses the supplied event as the result of the action.
- *
- * <p>The exception is matched against the various error message collections to determine whether to also set
- * one of the {@link AuthenticationErrorContext} flags to indicate a more specific error type.</p>
+ * necessary, beneath the {@link AuthenticationContext}.
+ *
+ * <p>The exception message is evaluated as a potential match as a "classified" error and if matched,
+ * the classification label is attached to the {@link AuthenticationErrorContext} and used as the
+ * resulting event for the action.
*
* @param profileRequestContext the current profile request context
* @param authenticationContext the current authentication context
* @param e the exception to process
- * @param eventId the event to "return" via an {@link org.opensaml.profile.context.EventContext}
+ * @param eventId the event to "return" via an {@link org.opensaml.profile.context.EventContext} if
+ * the exception message is not classified
*/
protected void handleError(@Nonnull final ProfileRequestContext profileRequestContext,
@Nonnull final AuthenticationContext authenticationContext, @Nonnull final Exception e,
@@ -283,13 +286,19 @@
}
/**
- * Adds a message encountered during the action to an {@link AuthenticationErrorContext}, creating one if
- * necessary, beneath the {@link AuthenticationContext}, and uses the supplied event as the result of the action.
+ * Evaluates a message as a potential match as a "classified" error and if matched, the classification
+ * label is attached to an {@link AuthenticationErrorContext} and used as the resulting event for the action.
+ *
+ * <p>If no match, the supplied eventId is used as the result.</p>
+ *
+ * <p>If multiple matches, the first matching label is used as the result, but each match is added to the
+ * context.</p>
*
* @param profileRequestContext the current profile request context
* @param authenticationContext the current authentication context
* @param message to process
- * @param eventId the event to "return" via an {@link org.opensaml.profile.context.EventContext}
+ * @param eventId the event to "return" via an {@link org.opensaml.profile.context.EventContext} if
+ * the message is not classified
*/
protected void handleError(@Nonnull final ProfileRequestContext profileRequestContext,
@Nonnull final AuthenticationContext authenticationContext, @Nonnull @NotEmpty final String message,
@@ -298,25 +307,39 @@
AuthenticationErrorContext errorCtx =
authenticationContext.getSubcontext(AuthenticationErrorContext.class, true);
- ActionSupport.buildEvent(profileRequestContext, eventId);
-
[... 279 lines stripped ...]
More information about the commits
mailing list