[java-identity-provider] branch master updated: Move failure counter maintenance to flow exit point.

Scott Cantor cantor.2 at osu.edu
Mon Mar 2 19:42:35 EST 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=dbefbba14c58201dd95c62fd9bb081bb434318a6

The following commit(s) were added to refs/heads/master by this push:
       new  dbefbba   Move failure counter maintenance to flow exit point.
dbefbba is described below

commit dbefbba14c58201dd95c62fd9bb081bb434318a6
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Mar 2 19:42:31 2020 -0500

    Move failure counter maintenance to flow exit point.
---
 idp-conf/src/main/resources/system/flows/authn/saml-authn-flow.xml   | 4 +++-
 .../idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java      | 5 -----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/idp-conf/src/main/resources/system/flows/authn/saml-authn-flow.xml b/idp-conf/src/main/resources/system/flows/authn/saml-authn-flow.xml
index 5be18e0..f0fdf6e 100644
--- a/idp-conf/src/main/resources/system/flows/authn/saml-authn-flow.xml
+++ b/idp-conf/src/main/resources/system/flows/authn/saml-authn-flow.xml
@@ -91,7 +91,9 @@
 
     <global-transitions>
         <!-- Route everything out as a graceful failure to allow subsequent options to run. -->
-        <transition on="#{!'proceed'.equals(currentEvent.id)}" to="ReselectFlow" />
+        <transition on="#{!'proceed'.equals(currentEvent.id)}" to="ReselectFlow">
+            <evaluate expression="T(org.opensaml.core.metrics.MetricsSupport).getMetricRegistry().counter('net.shibboleth.idp.authn.saml.failures').inc()" />
+        </transition>
     </global-transitions>
 
     <bean-import resource="saml-authn-beans.xml" />
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java
index b3ab4dd..b6f4317 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java
@@ -208,7 +208,6 @@ public class ValidateSAMLAuthentication extends AbstractValidationAction {
         if (authenticationContext.getAttemptedFlow() == null) {
             log.debug("{} No attempted flow within authentication context", getLogPrefix());
             ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
-            recordFailure();
             return false;
         }
         
@@ -216,7 +215,6 @@ public class ValidateSAMLAuthentication extends AbstractValidationAction {
         if (samlAuthnContext == null) {
             log.debug("{} No SAMLAuthnContext available within authentication context", getLogPrefix());
             ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.INVALID_CREDENTIALS);
-            recordFailure();
             return false;
         }
 
@@ -224,17 +222,14 @@ public class ValidateSAMLAuthentication extends AbstractValidationAction {
         if (rpContext == null) {
             log.error("{} Unable to locate RelyingPartyContext", getLogPrefix());
             ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_RELYING_PARTY_CTX);
-            recordFailure();
             return false;
         } else if (rpContext.getProfileConfig() == null) {
             log.error("{} Unable to locate profile configuration", getLogPrefix());
             ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_PROFILE_CONFIG);
-            recordFailure();
             return false;
         } else if (!(rpContext.getProfileConfig() instanceof BrowserSSOProfileConfiguration)) {
             log.error("{} Not a SAML 2 profile configuration", getLogPrefix());
             ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_PROFILE_CONFIG);
-            recordFailure();
             return false;
         }
         

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list