[java-identity-provider COMMIT] /trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractAuthenticationAct...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Jul 23 15:25:07 EDT 2013
Author: scantor
Date: Tue Jul 23 15:25:07 2013
New Revision: 4610
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4610&view=rev
Log:
Add pre-exec hook.
Modified:
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractAuthenticationAction.java
Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractAuthenticationAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractAuthenticationAction.java?rev=4610&r1=4609&r2=4610&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractAuthenticationAction.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractAuthenticationAction.java Tue Jul 23 15:25:07 2013
@@ -67,6 +67,23 @@
authnCtxLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy function cannot be null");
}
+
+ /** {@inheritDoc} */
+ protected final boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext)
+ throws ProfileException {
+
+ final AuthenticationContext authenticationContext = authnCtxLookupStrategy.apply(profileRequestContext);
+ if (authenticationContext == null) {
+ ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.INVALID_AUTHN_CTX);
+ return false;
+ }
+
+ if (doPreExecute(profileRequestContext, authenticationContext)) {
+ return super.doPreExecute(profileRequestContext);
+ } else {
+ return false;
+ }
+ }
/** {@inheritDoc} */
protected final void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) throws ProfileException {
@@ -81,6 +98,21 @@
}
/**
+ * Performs this authentication action's pre-execute step. Default implementation just returns true.
+ *
+ * @param profileRequestContext the current IdP profile request context
+ * @param authenticationContext the current authentication context
+ *
+ * @return true iff execution should continue
+ *
+ * @throws AuthenticationException thrown if there is a problem performing the authentication action
+ */
+ protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext,
+ @Nonnull final AuthenticationContext authenticationContext) throws AuthenticationException {
+ return true;
+ }
+
+ /**
* Performs this authentication action. Default implementation throws an exception.
*
* @param profileRequestContext the current IdP profile request context
More information about the commits
mailing list