[auth] Support refresh tokens for OAuth
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- java
- Domaine
- api, authentication, backend
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Java
- Étoiles
- 1.6k
- Forks
- 637
- Merge moyen
- 2 j 17 h
- PR mergées (30 j)
- 29
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ClickHouse/clickhouse-java
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
ClickHouse/clickhouse-java#3111 ·
-
area:data-type bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
ClickHouse/clickhouse-java#3098 · 1 commentaire ·
-
bug client-api-v2 test
Difficulté 2/5 1-3 heures Accessibilité débutants 92/100
ClickHouse/clickhouse-java#3076 ·
-
area:sql-parser bug client-v1
Difficulté 1/5 1-3 heures Accessibilité débutants 92/100
ClickHouse/clickhouse-java#3066 ·
-
area:general bug client-api-v2 jdbc jdbc-v2
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
ClickHouse/clickhouse-java#3063 ·
Toutes les issues de ClickHouse/clickhouse-java
Issues similaires
-
area-deployment area-integrations triage:bot-seen
Difficulté 2/5 Une demi-journée Accessibilité débutants 86/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/flink-agents#1156 ·
-
[source-shopify] FAILED bulk operation without partialDataUrl is silently treated as successful Ouvertearea/connectors autoteam community connectors/source/shopify needs-triage team/use type/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100