[java-identity-provider COMMIT] in /trunk: idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/ValidateDuo...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Oct 4 12:29:54 EDT 2016
Author: scantor
Date: Tue Oct 4 12:29:53 2016
New Revision: 8463
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8463&view=rev
Log:
IDP-908 - Reporting on authentication events
https://issues.shibboleth.net/jira/browse/IDP-908
Add success/failure tracking to the rest of the validators.
Modified:
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/ValidateDuoWebResponse.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.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/ValidateUsernamePasswordAgainstKerberos.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstLDAP.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateX509Certificate.java
trunk/idp-conf/src/main/resources/system/flows/authn/remoteuser-authn-beans.xml
trunk/idp-conf/src/main/resources/system/flows/authn/spnego-authn-beans.xml
trunk/idp-conf/src/main/resources/system/flows/authn/x509-authn-beans.xml
Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/ValidateDuoWebResponse.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/ValidateDuoWebResponse.java?rev=8463&r1=8462&r2=8463&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/ValidateDuoWebResponse.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/ValidateDuoWebResponse.java Tue Oct 4 12:29:53 2016
@@ -65,10 +65,13 @@
* @since 3.3.0
*/
public class ValidateDuoWebResponse extends AbstractValidationAction {
-
+
/** Signed response parameter name. */
@Nonnull @NotEmpty public static final String RESPONSE_PARAM = "sig_response";
-
+
+ /** Default prefix for metrics. */
+ @Nonnull @NotEmpty private static final String DEFAULT_METRIC_NAME = "net.shibboleth.idp.authn.duo";
+
/** Class logger. */
@Nonnull private final Logger log = LoggerFactory.getLogger(ValidateDuoWebResponse.class);
@@ -91,6 +94,7 @@
public ValidateDuoWebResponse() {
duoIntegrationLookupStrategy = FunctionSupport.constant(null);
usernameLookupStrategy = new CanonicalUsernameLookupStrategy();
+ setMetricName(DEFAULT_METRIC_NAME);
}
/**
@@ -141,6 +145,7 @@
if (duoIntegration == null) {
log.warn("{} No DuoIntegration returned by lookup strategy", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
+ recordFailure();
return false;
}
@@ -155,6 +160,7 @@
if (servletRequest == null) {
log.error("{} No ServletRequest available", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
+ recordFailure();
return false;
}
@@ -162,6 +168,7 @@
if (signedResponse == null || signedResponse.isEmpty()) {
log.warn("{} No signed Duo response in the request", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.NO_CREDENTIALS);
+ recordFailure();
return false;
}
@@ -181,6 +188,7 @@
} catch (final InvalidKeyException | NoSuchAlgorithmException | DuoWebException | IOException e) {
log.warn("{} Error validating signed Duo response for username '{}'", getLogPrefix(), username, e);
handleError(profileRequestContext, authenticationContext, e, AuthnEventIds.INVALID_CREDENTIALS);
+ recordFailure();
return;
}
@@ -189,8 +197,10 @@
getLogPrefix(), usernameFromDuo, username);
handleError(profileRequestContext, authenticationContext, AuthnEventIds.INVALID_CREDENTIALS,
AuthnEventIds.INVALID_CREDENTIALS);
+ recordFailure();
} else {
log.info("{} Duo authentication succeeded for '{}'", getLogPrefix(), usernameFromDuo);
+ recordSuccess();
buildAuthenticationResult(profileRequestContext, authenticationContext);
}
}
Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthentication.java?rev=8463&r1=8462&r2=8463&view=diff
[... 351 lines stripped ...]
More information about the commits
mailing list