[java-plugin-shibd] 01/02: Clean up logging when shared secrets absent.
Codeberg
noreply at shibboleth.net
Tue Nov 3 18:57:31 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-plugin-shibd.
View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/acdf80d98e416fd340c47b7dda2bbd7b4b9f0123
commit acdf80d98e416fd340c47b7dda2bbd7b4b9f0123
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue Nov 3 13:54:54 2026 -0500
Clean up logging when shared secrets absent.
---
.../sp/authn/impl/AgentSecretCredentialValidator.java | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/authn/impl/AgentSecretCredentialValidator.java b/sp-server-impl/src/main/java/net/shibboleth/sp/authn/impl/AgentSecretCredentialValidator.java
index c418df2..93fa778 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/authn/impl/AgentSecretCredentialValidator.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/authn/impl/AgentSecretCredentialValidator.java
@@ -98,6 +98,9 @@ public class AgentSecretCredentialValidator extends AbstractUsernamePasswordCred
return null;
}
+ // Tracks for logging whether any secrets are seen.
+ boolean hasSharedSecret = false;
+
// The username and password fields are non-null per base class.
log.debug("{} Attempting to authenticate agent '{}' with username '{}'", getLogPrefix(), agent.getId(),
@@ -110,6 +113,8 @@ public class AgentSecretCredentialValidator extends AbstractUsernamePasswordCred
continue;
}
+ hasSharedSecret = true;
+
// Compare username against credential mapping key or agent ID as fallback if null...
if (Constraint.isNotNull(usernamePasswordContext.getUsername(), "Username was null").equals(
candidate.getKey() != null ? candidate.getKey() : agent.getId())) {
@@ -121,12 +126,16 @@ public class AgentSecretCredentialValidator extends AbstractUsernamePasswordCred
candidate.getKey());
return populateSubject(new Subject(), usernamePasswordContext);
}
-
}
}
-
+
+ if (!hasSharedSecret) {
+ log.debug("{} No shared secrets configured locally for agent '{}', ignoring", getLogPrefix(), agent.getId());
+ return null;
+ }
+
log.info("{} Authentication of agent '{}' failed", getLogPrefix(), agent.getId());
-
+
final LoginException e = new LoginException(AuthnEventIds.INVALID_CREDENTIALS);
if (errorHandler != null) {
errorHandler.handleError(profileRequestContext, authenticationContext, e,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list