Skip to content

Make clientId optional in DatabricksOAuthTokenSource#765

Open
renaudhartert-db wants to merge 2 commits intomainfrom
fix/issue-757-optional-client-id
Open

Make clientId optional in DatabricksOAuthTokenSource#765
renaudhartert-db wants to merge 2 commits intomainfrom
fix/issue-757-optional-client-id

Conversation

@renaudhartert-db
Copy link
Copy Markdown
Contributor

Summary

  • DatabricksOAuthTokenSource required a non-null, non-empty clientId, which blocked users authenticating via web browser OIDC federation flows where no client ID is available in the IdP JWT token.
  • RFC 8693 makes client_id optional for token exchange requests. The client_id parameter is now only included when the value is non-null and non-empty. Fully backward compatible.

Test plan

  • Updated "Null client ID" test: now expects successful token exchange (was NullPointerException)
  • Updated "Empty client ID" test: now expects successful token exchange (was IllegalArgumentException)
  • Both tests verify client_id is absent from the request body
  • All 14 DatabricksOAuthTokenSourceTest tests pass
  • Formatted with fmt-maven-plugin

Fixes #757

Users authenticating via web browser OIDC federation flows do not have
a client ID in their IdP JWT token. RFC 8693 makes client_id optional
for token exchange requests. The SDK was over-constraining by requiring
it. Skip the client_id parameter when it is null or empty.

Fixes #757
@github-actions
Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-java

Inputs:

  • PR number: 765
  • Commit SHA: 0c221fa8ad13ad5bc67105d6193618e9ea8b748e

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE] DatabricksOAuthTokenSource relies on mandatory client id - not suitable for Web oauth2 use cases

1 participant