Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[auth] Support refresh tokens for OAuth

Open
#3,145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java

Research direction

The issue describes adding OAuth refresh token support to the ClickHouse Java client. Start by examining the existing authentication and connection handling code, likely in packages related to client configuration and HTTP/API communication. Look for where JWT tokens are currently managed and where token expiration errors are thrown. The solution involves designing a callback interface, a default implementation, and integrating this with the JDBC driver. Check for existing tests around authentication to understand the current behavior and add tests for the new refresh flow.

Written by the indexing model from the issue text.

Description

area:integration client-api-v2 jdbc-v2
Description

ClickHouse Cloud supports JWT for Authentication. This opens a way to support OAuth 2.0. This standard is used to authenticate users for accessing service (and more). There is a thing called "Refresh token" that helps to reduce life of access token and avoid frequent user interactions. It is all needed because JWT is signed "key" to access something and by designed it cannot be invalidated in real time until it expires. So short TTL would solve problem of invalidating tokens faster but it creates problem of requesting new access token too frequently. Thus another "refresh" token comes into play - it is used to request next pair of access token / refresh token from authentication provider without user interaction. If user has no more access to resources / service it tries to reach then refresh fails.

Read more https://auth0.com/docs/secure/tokens/refresh-tokens

There is a mostly standard procedure of getting tokens described here

Client should handled expired token error from ClickHouse Cloud and call the procedure.
Documentation should state that if operation has some timeout this refresh will make request to fail but anyway.

Design

  • there should be callback for token expiration errors. Just a callback that can be implemented by user
  • there should be a default callback implementation with own config that can do "standard" refresh. config should be prefixed with "ouath_refresh_".
  • when callback is not set exception is thrown to application
  • token refresh code should be usable to run in timer when application want to avoid expiration of a previous JWT (useful when need to have strict timeout on operation and handle auto-refresh)
  • there should be a solution for JDBC
Dominant language
Java
Stars
1.6k
Forks
637
Avg merge
2d 17h
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ClickHouse/clickhouse-java

All issues in ClickHouse/clickhouse-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.