feat: add support for enterprise principal login in SpnegoClient with…#107
Merged
Conversation
… Kerby provider Signed-off-by: Dmitry Bedrin <dmitry.bedrin@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a new SpnegoClient login factory for enterprise principal usernames (e.g., AD UPNs like user@corp.example) backed by the Apache Kerby provider, enabling NT_ENTERPRISE-style AS-REQs while keeping the JDK provider behavior unchanged (explicitly unsupported).
Changes:
- Added
SpnegoClient.loginWithEnterprisePrincipal(...)with optional caching support, delegating to the selectedSpnegoClientProvider. - Implemented enterprise-principal TGT acquisition in the Kerby provider and added coverage for both Kerby (supported) and JDK (unsupported) providers.
- Updated documentation (README + CHANGES) to describe enterprise principal usage and provider limitations.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents enterprise principal login usage and clarifies Kerby vs JDK provider behavior. |
| kerb4j-common/src/main/java/com/kerb4j/client/SpnegoClient.java | Adds loginWithEnterprisePrincipal(...) factory and extends cache keying to distinguish auth types. |
| kerb4j-common/src/main/java/com/kerb4j/client/spi/SpnegoClientProvider.java | Introduces a default loginWithEnterprisePrincipal(...) SPI method (unsupported by default). |
| kerb4j-client-kerby/src/main/java/com/kerb4j/client/kerby/KerbySpnegoClientProvider.java | Implements enterprise-principal authentication using Kerby internal client request options. |
| kerb4j-client-kerby/src/test/java/com/kerb4j/client/kerby/KerbySpnegoClientProviderTest.java | Adds an integration-style test verifying enterprise principal token creation/acceptance with Kerby. |
| kerb4j-client-jdk/src/main/java/com/kerb4j/client/jdk/JdkSpnegoClientProvider.java | Explicitly rejects enterprise principal login with UnsupportedOperationException. |
| kerb4j-client-jdk/src/test/java/com/kerb4j/client/jdk/JdkSpnegoClientProviderTest.java | Adds a test asserting enterprise principal login is unsupported on the JDK provider. |
| CHANGES.md | Adds release notes entry for the new enterprise principal login factory. |
Comment on lines
324
to
332
| private static final class CacheKey extends AbstractMap.SimpleEntry<String, String> { | ||
| private final String type; | ||
| private final String provider; | ||
|
|
||
| private CacheKey(String provider, String key, String value) { | ||
| private CacheKey(String type, String provider, String key, String value) { | ||
| super(key, value); | ||
| this.type = type; | ||
| this.provider = provider; | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
… Kerby provider