feat(java/driver/flight-sql): add OAuth2 support#4290
Open
lxyzxx wants to merge 1 commit intoapache:mainfrom
Open
feat(java/driver/flight-sql): add OAuth2 support#4290lxyzxx wants to merge 1 commit intoapache:mainfrom
lxyzxx wants to merge 1 commit intoapache:mainfrom
Conversation
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.
This change follows the earlier discussion in #4272.
Now that Arrow Java 19.0.0 has been merged, Java ADBC Flight SQL can reuse the OAuth2 support already implemented in Arrow Java. This commit wires that existing Arrow Java OAuth2 implementation into the Java ADBC Flight SQL driver, instead of introducing a separate OAuth implementation on the ADBC side.
What changed
client_credentialstoken_exchangeAdbcExceptionstatus codes during connection setupFlightClienton failed authentication / handshake pathsUsage notes
For
client_credentials, configure:adbc.flight.sql.oauth.flowadbc.flight.sql.oauth.token_uriadbc.flight.sql.oauth.client_idadbc.flight.sql.oauth.client_secretFor
token_exchange, use the correspondingadbc.flight.sql.oauth.exchange.*properties.OAuth token endpoint HTTPS validation follows the Arrow Java / JVM SSL behavior and uses the JVM SSL configuration, such as:
javax.net.ssl.trustStorejavax.net.ssl.trustStorePasswordjavax.net.ssl.trustStoreTypeFlight server TLS continues to use the existing ADBC Flight SQL TLS connection properties.
Token refresh / re-acquisition is delegated to the reused Arrow Java OAuth provider and happens on demand when a valid token is needed for a request.
Validation
client_credentialsagainst a local Keycloak setup