Repository navigation
Avoid logging SPNEGO credentials in log - #53395
Merged
ahus1 merged 2 commits intoOct 1, 2026
Merged
Conversation
Closes keycloak#52680 Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new token-length logging introduces a null dereference before existing exception handling.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Prevents SPNEGO credential material from being exposed in Kerberos logs.
Changes:
- Logs token lengths instead of token values.
- Removes delegation credential values from logging.
| File | Description |
|---|---|
SPNEGOAuthenticator.java |
Redacts SPNEGO and delegation credentials from logs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alexander Schwartz <alexander.schwartz@gmx.net>
ahus1
marked this pull request as ready for review
October 1, 2026 11:57
ahus1
enabled auto-merge (squash)
October 1, 2026 11:57
stianst
reviewed
Oct 1, 2026
| public void authenticate() { | ||
| if (log.isTraceEnabled()) { | ||
| log.trace("SPNEGO Login with token: " + spnegoToken); | ||
| log.trace("SPNEGO Login with token length: " + (spnegoToken != null ? spnegoToken.length() : 0)); |
Contributor
There was a problem hiding this comment.
Is the length useful information at all? Seems like that can just be removed?
stianst
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #52680