[security] PlainSaslServerProvider conflicts with Hadoop SASL provider causing authentication failure
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- hadoop, java
- Domain
- authentication, security
Research direction
Start by reading PlainSaslServerProvider.java and its initialize() method, then review how Java Security provider ordering affects Sasl.createSaslServer("PLAIN", ...). Done means Fluss's provider is registered ahead of Hadoop's provider so CLIENT:SASL authentication no longer fails with UnsupportedCallbackException.
Written by the indexing model from the issue text.
Description
Search before asking
- I searched in the issues and found nothing similar.
Fluss version
main (development)
Please describe the bug 🐞
When running Fluss in an environment where Hadoop / HDFS dependencies are present on the classpath (for instance, when enabling HDFS remote log tiering or Paimon lake tiering), Hadoop's SaslRpcServer class registers its own SaslPlainServer.SecurityProvider into Java's Security providers.
Currently, Fluss initializes its SASL/PLAIN provider in PlainSaslServerProvider.java:
public static void initialize() {
Security.addProvider(new PlainSaslServerProvider());
}
Security.addProvider() appends Fluss's PlainSaslServerProvider to the end of the provider list.
When a client attempts to connect to Fluss using SASL/PLAIN authentication (CLIENT:SASL), Java's Sasl.createSaslServer("PLAIN", ...) iterates through the registered providers and selects the first matching PLAIN provider, which is Hadoop's SaslPlainServer.SecurityProvider instead of Fluss's.
Because Hadoop's SASL PLAIN provider expects Hadoop-specific callbacks, it fails during authentication:
WARN org.apache.fluss.rpc.netty.server.NettyServerHandler - Connection is still in the authentication process. Unable to handle API key: 1012.
...
PLAIN auth failed: javax.security.auth.callback.UnsupportedCallbackException: Unrecognized Callback
at org.apache.hadoop.security.SaslRpcServer$SaslPlainServer$SecurityProvider...
This causes all client SASL authentication attempts to fail.
Solution
In PlainSaslServerProvider.initialize(), use Security.insertProviderAt(new PlainSaslServerProvider(), 1); to register Fluss's PLAIN provider at the first position.
This guarantees that Fluss's own PlainSaslServer is always preferred over any third-party providers (such as Hadoop). This aligns with the implementation in Apache Kafka (org.apache.kafka.common.security.plain.PlainSaslServerProvider), which also uses Security.insertProviderAt(new PlainSaslServerProvider(), 1).
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 656
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 108
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/fluss
-
[CI] NettyClientTest.testServerDisconnection may fail with DisconnectExceptionPossibly taken @yangshangqing95 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` keyPossibly taken @aphenix-r7 claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/fluss#4658 · 1 comment ·
Maintainers usually reply within 1 day
-
[common] Decimal#hashCode is inconsistent with Decimal#equalsPossibly taken @firasbouzazi claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/fluss#4538 · 1 comment ·
Maintainers usually reply within 1 day
-
[server] KV snapshot scheduling stops permanently after a transient snapshot-init failurePossibly taken @zhang-arvin claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/fluss#4489 · 1 comment ·
Maintainers usually reply within 1 day
-
[docs] Document advertised-resource and ACL principal ignore-case optionsPossibly taken @EchoLee5 claimed this 33 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/rocketmq-dashboard#7039 ·
Maintainers usually reply within 3 days
-
pdfium-drift
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Stirling-Tools/JPDFium#176 ·
Maintainers usually reply within 1 day
-
Guidelines: redundant use cases, stale dev bundle after snapshot bumps, looking up snapshot APIPossibly taken @totally-not-ai claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vaadin/use-cases#441 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hiero-ledger/hiero-consensus-node#27712 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
Vakore/ZappierGames#162 ·